I have a small Swift command line tool for MacOS.
I have added a small demo CoreML model to the project and can correctly load the model in Swift like let model = try! Matcher_512x256().
However, once I add a single C++ or Objective C file to the Compile Sources of my build target, the compilation fails with an error stating that the model cannot be found: "...ModelAndCpp/ModelAndCpp/main.swift:11:18 Cannot find 'Matcher_512x256' in scope".
Please help me resolve this. Does XCode change into a different "compilation mode" once a C++ file is present which might cause this error? XCode version is 16A242d.
I can reproduce the issue with a tiny repository (5 small files) which I have uploaded here on GitHub.
To reproduce the issue, simply remove the .m and .cpp files from Compile Sources to compile correctly, or add one of them to get the error.
Thank you and best regards,
Manuel
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I’ve recently begun learning how to utilize Xcode. I have an app in Xcode that closely resembles the iOS App template. Whenever I initiate a build, it successfully completes, but it never finishes installing views into the iOS Simulator. This issue is also present when I attempt to preview the app within the Xcode editor.
I am currently using a 2020 MacBook Air (M1). Have you encountered a similar problem? If so, how did you resolve it?
[Written using Apple Inteligence Writing Tools]
Have been using Xcode 16.0 on this Mac successfully but now Xcode won't open. The welcome screen appears but the rotating indicators run apparently forever. MacBook Air recently updated to Sequoia 15.0
Topic:
Developer Tools & Services
SubTopic:
Xcode
This project had been stable for years, doing hundreds of updates for customers but XCode has suddenly started generating lists of errors with every build.
I have sent in reports in Feedback Assistant but never get any response. Is this a recent regression in XCode?
This project is Objective-C++ with C++11, clang with lots of assembly for both CPU families.
Cleaning up ...
Building XCode Project...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006001-000851861A42401E }
{ platform:macOS, arch:x86_64, id:00006001-000851861A42401E }
{ platform:macOS, name:Any Mac }
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006001-000851861A42401E }
{ platform:macOS, arch:x86_64, id:00006001-000851861A42401E }
{ platform:macOS, name:Any Mac }
2024-10-02 22:42:09.000 xcodebuild[3235:7055835] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot11/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-22269/IDEFoundation/Provisioning/Capabilities Infrastructure/IDECapabilityQuerySelection.swift:103
Details: createItemModels creation requirements should not create capability item model for a capability item model that already exists.
Function: createItemModels(for:itemModelSource:)
Thread: <_NSMainThread: 0x6000033fc2c0>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2024-10-02 22:42:09.000 xcodebuild[3235:7055835] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot11/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-22269/IDEFoundation/Provisioning/Capabilities Infrastructure/IDECapabilityQuerySelection.swift:103
Details: createItemModels creation requirements should not create capability item model for a capability item model that already exists.
Function: createItemModels(for:itemModelSource:)
Thread: <_NSMainThread: 0x6000033fc2c0>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2024-10-02 22:42:09.000 xcodebuild[3235:7055835] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot11/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-22269/IDEFoundation/Provisioning/Capabilities Infrastructure/IDECapabilityQuerySelection.swift:103
Details: createItemModels creation requirements should not create capability item model for a capability item model that already exists.
Function: createItemModels(for:itemModelSource:)
Thread: <_NSMainThread: 0x6000033fc2c0>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2024-10-02 22:42:09.000 xcodebuild[3235:7055835] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot11/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-22269/IDEFoundation/Provisioning/Capabilities Infrastructure/IDECapabilityQuerySelection.swift:103
Details: createItemModels creation requirements should not create capability item model for a capability item model that already exists.
Function: createItemModels(for:itemModelSource:)
Thread: <_NSMainThread: 0x6000033fc2c0>{number = 1, name = main}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2024-10-02 22:42:09.000 xcodebuild[3235:7055835] [MT] DVTAssertions: Warning in
=== CUT 10000 LINES of XCode Errors ===
PS: the maximum length on these forum posts is crazy small!
Can Xcode15 compile on an iPhone of iOS18?I want to update my iPhone to iOS18, but I do not want to update my Xcode.
I just upgraded to Version 16.0 (16A242d) and unfortunately the App that used to run perfectly fine on Xcode 15 is now broken. It crashes right after showing the Launch Screen on the Simulator. Here's the formatted error message in the Console:
dyld[80159]: Library not loaded: @rpath/AppName-iOS.debug.dylib
Referenced from: <App ID> /path/to/AppName-iOS.app/AppName-iOS
Reason: tried: '/path/to/DerivedData/AppName-iOS.debug.dylib' (no such file),
'/path/to/CoreSimulator/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/AppName-iOS.debug.dylib' (no such file),
'/path/to/AppName-iOS.app/AppName-iOS.debug.dylib' (code signature not valid for use in process: Trying to load an unsigned library),
'/path/to/DerivedData/PackageFrameworks/AppName-iOS.debug.dylib' (no such file),
'/path/to/AppName-iOS.app/Frameworks/AppName-iOS.debug.dylib' (no such file),
'/path/to/CoreSimulator/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/AppName-iOS.debug.dylib' (no such file)
For some reason the Library is unsigned and I've checked all the settings with no luck.
I have Xcode 16 and iPadOS 18.0
I am trying other connect the iPad to Xcode.
It started with preparing iPad and
Xcode will continue when the operation completes.
It hangs now for 2 hours. What is wrong with it?
There is lot of space at the iPad
IOS 18.0 (22A3354)
Pad Pro (11-inch) (2nd generation)
It worked earlier with Xcode 15 and iPadOS 17
After upgrading to iOS 18, in my app development using xCode 16.0 (16A242d) and Swift, I am totally unable to obtain an APNS token from my own device using didRegisterForRemoteNotificationsWithDeviceToken
The delegate simply won’t fire.
I was able to do so repeatedly in the same app a week earlier, using iOS 17xx. That part of the code has not changed.
I just now restored my phone and installed a clean version of iOS 18, but the issue has not changed.
Have tried using WiFi and also cellular networks.
It is a no-go.
I am trying to add a Swift Package from a private Gitlab repository to my Xcode 16 project, and it fails. First symptom is Unable to load the Read Me in the Xcode SPM package browser. And when I add the package, I get a repo.git could not be resolved error.
I've used ProxyMan to sniff the network calls issued by Xcode, and it looks like my Gitlab credentials are not provided as part of the GET request when, for example, Xcode tries to fetch the README.md file from the repository. And when I try to add the package, there are no HTTP network calls issued by Xcode at all.
I have tried adding a Gitlab account to Xcode's Accounts preference pane, and entering the repository's credentials directly when adding the package. Both yield the same result.
Here's a screen capture of Xcode trying to fetch the README:
https://share.cleanshot.com/FNRHm6fq
I am unable to test this in Xcode 15, as I have upgraded my Mac to Sequoia and Xcode 15 can't be installed on this version of macOS.
I have submitted FB15370281 for this issue.
My app has extensions, including a share extension. When I upgraded to Sonoma and Xcode 16, the share extension compiles but it does not show up as an share option in any apps. The other extensions are working correctly.
So I then created a blank project from scratch and created a new share extension using the included wizard. I added the appropriate extension options, and no matter what I tried, even TRUEPREDICATE, the share extension will not show. I confirmed the target deployment matches the main project and went through every possible check. No matter what I do, the share extension will not show (tested on ios 15, 16,17, and 18. I am pretty certain that there is a bug in either X code 16 or in X code 16 with Sonoma. Please verify - try to create a share extension and see if it works.
Help is appreciated.
I've got a 2023 M2 MacBook Pro and used to get great battery life out of it (> 6 hours when using it for development purposes).
Now however, all of a sudden, that has dropped off a cliff, and the only thing that has changed is Xcode 16 has appeared.
As I'm compiling a project I can literally see the % amount of the battery charge remaining tick down in front of my eyes as I watch.
I just compiled a project twice and during that time the battery dropped from from %89 to %79 and Xcode is listed as a culprit using significant battery drain.
Anybody else noticed anything similar?
Anything that can be done to to decrease Xcode's battery drain?
Hi,
I'm trying to use the appIcon command of devicectl. I'm connecting to an iPhone 14 Pro running iOS 17.0.2.
xcrun devicectl device info appIcon --help
OVERVIEW: Request app icon generation from this device.
This command searches for an app installed on this device and requests for its icon to be generated.
USAGE: devicectl device info appIcon [<options>] --device <uuid|ecid|udid|name> --allow-placeholder <allow placeholder> --width <width> --height <height> --scale <scale>
DEVICE OPTIONS:
-d, --device <uuid|ecid|udid|name>
The identifier, ECID, UDID, or name of the device.
COMMAND OPTIONS:
--app-bundle-id <app bundle identifier>
Look for app icon information with the given application bundle identifier on device.
Note: If both app-bundle-id and app-path are provided, only app-path will be used.
--app-path <app path> Look for app icon information at the given application path on device.
Note: If both app-bundle-id and app-path are provided, only app-path will be used.
--allow-placeholder <allow placeholder>
Allow placeholder icons to be generated.
Note: Passing `true` will allow placeholder icons to be returned. Allowing placeholder icons will ensure no I/O is done on device. If you want to make sure you get the icon
most accurate to your request -- which could use more resources on the device -- set this to `false`.
--width <width> Request app icon generation with the specified width.
--height <height> Request app icon generation with the specified height.
--scale <scale> Request app icon generation with the specified scale.
--destination <destination>
Write the image (in png format) to the provided file on the host device.
OUTPUT OPTIONS:
-v, --verbose If given, provide more logging output than normal.
-q, --quiet If given, output will include only errors.
-t, --timeout <seconds> The overall command timeout in seconds. If this limit is exceeded the command is abandoned as a failure.
-j, --json-output <path>
An optional path to write a JSON file with command results.
Note: JSON output to a user-provided file on disk is the ONLY supported interface for scripts/programs to consume command output.
-l, --log-output <path> An optional path to write all logging otherwise passed to stdout/stderr.
OPTIONS:
--version Show the version.
-h, --help Show help information.
I've tried multiple variations of parameters and both apple-bundle-id and app-path, but always receive an error.
xcrun devicectl device info appIcon --device *** --app-bundle-id *** --app-path *** --allow-placeholder true --width 60 --height 60 --scale 3 --destination icon.png -j icon.json -t 10 -v
With JSON output
"error" : {
"code" : 6007,
"domain" : "com.apple.dt.CoreDeviceError",
"userInfo" : {
"NSLocalizedDescription" : {
"string" : "CGImage was nil when attempting to write to a destination."
}
}
},
Without JSON output
09:32:42 Acquired tunnel connection to device.
09:32:42 Enabling developer disk image services.
09:32:42 Acquired usage assertion.
Application Icon Image Information
• Is Placeholder - false
• Size
• Height - 0.0
• Width - 0.0
• Scale - 0.0
• Pixel Size
• Height - 0.0
• Width - 0.0
Has anyone managed to successfully extract an app icon using devicectl?
Hi there,
I'm trying to use XCode and Jasonette to put a wrapper around my app. I ran a simulation last night and it worked great. This morning I opened XCode back up and the only thing I changed was the name of the app, and suddenly the simulator won't open now that I try to do a test run. It is saying it has built successfully, but I can't figure out how to get the simulator up and running again. Totally flummoxed here :/
I boot from an external drive. Content assist in Xcode seems to not work any more. Is that because it is blocked by the unavailability of predictive code completion?
I understand that predictive code completion does not work when booting from externals, and have asked (begged?) for details so that I can migrate to booting from an internal drive:
https://developer.apple.com/forums/thread/764688
But would someone (anyone?) please confirm that other forms of content assist still work in Xcode 16 when booting from an external drive? (Then I'll continue looking for why it's not working in my case.)
(Separately, I'd love answers to my other posting so I can migrate to booting from the internal drive.)
Topic:
Developer Tools & Services
SubTopic:
Xcode
Explanation:
I am working on an application and had trouble diagnosing the warnings below. I pulled the search bar code out into a separate project, and the warnings still show up. The entire code for the sample project is shown below. The "AddInstanceForFactory", "LoudnessManager", and "NSBundle" warning all show up immediately after tapping the search bar. The "RTIInputSystemClient" warning arises after tapping, dismissing, and re-tapping the search bar.
Any help with resolving these warnings is appreciated!
Warnings:
"-[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = , customInfoType = UIEmojiSearchOperations"
"NSBundle file:///Library/Developer/CoreSimulator/Volumes/iOS_22A3351/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS%2018.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed"
"AddInstanceForFactory: No factory registered for id <CFUUID --------------> -----------------"
"LoudnessManager.mm:709 unable to open stream for LoudnessManager plist"
Code:
import UIKit
class SearchView: UIView {
private lazy var searchBar: UISearchBar = {
let searchBar = UISearchBar()
searchBar.delegate = self
searchBar.translatesAutoresizingMaskIntoConstraints = false
searchBar.placeholder = "Search"
return searchBar
}()
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
init() {
super.init(frame: .zero)
translatesAutoresizingMaskIntoConstraints = false
backgroundColor = .yellow
addSubview(searchBar)
NSLayoutConstraint.activate([
searchBar.topAnchor.constraint(equalTo: topAnchor, constant: 12),
searchBar.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 12),
searchBar.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -12),
searchBar.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -12),
])
}
}
extension SearchView: UISearchBarDelegate {
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
print(searchText)
}
}
class ViewController: UIViewController {
private lazy var searchView = SearchView()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .red
let tap = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
view.addGestureRecognizer(tap)
view.addSubview(searchView)
NSLayoutConstraint.activate([
searchView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
searchView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 24),
searchView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
])
}
@objc func dismissKeyboard() {
view.endEditing(true)
}
}
hello,
i want to test my app on an iPhone15 pro simulated device runnig ios 17,5
i have installed os images
i have created a new simulated device
But i do not see him into xcode 16 tool barr window as i want to run my app on this particular device
i only a small list of devices
please do not tell me again it is about some "/usr/var right acces problem" stuff
i am very desapointed by new software releases that are working baddly compare to their previous version
Hello,
I have multiple iOS applications using Xcode projects built with Flutter. Originally I created this applications with my Apple ID, however, since then I lost access to my Apple ID's email. I updated my Apple ID email to a new email and now I cannot even build an app locally for the iOS Simulator.
I'm on macOS 15 / iOS 18 simulator.
Here is the output from xcodebuild:
DVTDeveloperAccountManager: Failed to load credentials for [OLD_EMAIL]: Error Domain=DVTDeveloperAccountCredentialsError Code=0 "Invalid credentials in keychain for [OLD_EMAIL], missing Xcode-Token" UserInfo={NSLocalizedDescription=Invalid credentials in keychain for [OLD_EMAIL], missing Xcode-Token}
Where OLD_EMAIL is the old Apple ID email.
When I go into my Keychain Access app, I remove all references to my old email, but they regenerate when trying to build the app. I've tried doing manually signing on the xcode project config, but that gives the same error as well.
This is only on old projects. When I run a new project, I do not have any errors building or uploading to App Store Connect.
Any help would be greatly appreciated. Thank you
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hi,
I am creating a custom NSSecureUnarchiveFromDataTransformer in order to handle attributes of entities of type NSDateComponents.
It all works and I did not see any warnings in the "Issue navigator" inside Xcode but with Xcode 15 I started seeing this warning:
/Users/.../CustomNSSecureUnarchiveFromDataTransformer/CoreData:1:1 no NSValueTransformer with class name 'CustomSecureUnarchiveFromDataTransformer' was found for attribute 'testDate' on entity 'Item'
My use case is very simple, I have this custom transformer:
@objc(CustomSecureUnarchiveFromDataTransformer)
final class CustomSecureUnarchiveFromDataTransformer: NSSecureUnarchiveFromDataTransformer {
override class var allowedTopLevelClasses: [AnyClass] {
return [NSDateComponents.self]
}
static let name = NSValueTransformerName(rawValue: String(describing: CustomSecureUnarchiveFromDataTransformer.self))
public static func register() {
let transformer = CustomSecureUnarchiveFromDataTransformer()
ValueTransformer.setValueTransformer(transformer, forName: name)
}
}
which is set to the Core data entity's "Transformer":
which leads to the warning in Xcode 15.
App works just fine and there are no problems during run time, but this warning is shown and I want to fix it.
Here is a simple test project https://github.com/VladimirAmiorkov/CustomNSSecureUnarchiveFromDataTransformer
Hello
We have a health app that triggers a critical alert when a vital limit is exceeded. Used to work fine until IOS 18 update. Now, after the update, critical alert is triggered correctly when connected to Xcode. However, when disconnected from Xcode, nothing happens.
Please help
I'm trying to get our CI working to build our own machine image AMI descriptions. Part of that is to download the correct runtime versions so that we can pre-create the simulators we use for testing on these machine image descriptions.
When running the code like
xcodebuild -downloadPlatform <platform> -exportPath "$<temp_folder_path>"
Locally I get a result and download a runtime, but on CI I just get All available platforms are downloaded. Why is this message happening and how can I specify specific platforms to download over CI to configure our machine setup?