Build, test, and submit your app using Xcode, Apple's integrated development environment.

Posts under Xcode tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Resolving a "Simulator runtime is not available" error
Some Macs recently received a macOS system update which disabled the simulator runtimes used by Xcode 15, including the simulators for iOS, tvOS, watchOS, and visionOS. If your Mac received this update, you will receive the following error message and will be unable to use the simulator: The com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime is not available. Domain: com.apple.CoreSimulator.SimError Code: 401 Failure Reason: runtime profile not found using "System" match policy Recovery Suggestion: Download the com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime from the Xcode To resume using the simulator, please reboot your Mac. After rebooting, check Xcode Preferences → Platforms to ensure that the simulator runtime you would like to use is still installed. If it is missing, use the Get button to download it again. The Xcode 15.3 Release Notes are also updated with this information.
0
0
2k
May ’24
How to change the icon when the application is in the "ready to submit" stage
I filled in some information when publishing the application and felt that the icon was not good enough. I made another one and used this new icon in XCode. After running it on iPhone, the icon changed, but there was no change in the submission section. Now the application is in the "ready to submit" stage and I don't know how to change it to the new icon. Can anyone give me some guidance? Thank you!
0
0
48
7h
Developer account can't be added on a virtualised macOS using Virtualization framework
Dear Support Team, I constantly get a 401 unauthorised error, when I try to add my Developer account in Xcode while running a virutalised macOS using https://developer.apple.com/documentation/virtualization. So I can't use signing, entitlements, etc when building within a virutalised macOS. The error shown is below: There was a failure decoding response: (HTTP 401, 60 bytes) The data couldn’t be read because it isn’t in the correct format. I've found probably the same issue here https://developer.apple.com/forums/thread/759877 Unfortunately, I can't find any updates. Are you aware of this problem? Are there any planned fixes in upcoming macOS updates? 15.0 (24A335) Version 16.1 (16B40) Apple M1 Pro, 16 GB Ram Best regards, Evgenii
0
0
59
9h
Issue with using Swift package with xcframework binaryTarget
Hi! I'm trying to create a target application that depends on multiple targets that all use the same Swift package that has xcframework binaryTarget. Each component can be successfully assembled individually, but when I try to create a core application that depends on these components, I get an error message on Prepare build stage: Multiple commands produce '/Users/<USER>/Library/Developer/Xcode/DerivedData/<PROJECT_ID>/Build/Products/Debug/Frameworks/<FW_NAME>.framework/Versions/A' Target '<COMPONENT1>' has copy command from '/Users/<USER>/Library/Developer/Xcode/DerivedData/<PROJECT_ID>/SourcePackages/artifacts/.../<FW_NAME>/<FW_NAME>.xcframework/macos-arm64_x86_64/<FW_NAME>.framework' to '/Users/<USER>/Library/Developer/Xcode/DerivedData/<PROJECT_ID>/Build/Products/Debug/Frameworks/<FW_NAME>.framework' Target '<COMPONENT2>' has copy command from '/Users/<USER>/Library/Developer/Xcode/DerivedData/<PROJECT_ID>/SourcePackages/artifacts/.../<FW_NAME>/<FW_NAME>.xcframework/macos-arm64_x86_64/<FW_NAME>.framework' to '/Users/<USER>/Library/Developer/Xcode/DerivedData/<PROJECT_ID>/Build/Products/Debug/Frameworks/<FW_NAME>.framework' – where <FW_NAME> is a name of the xcframework which is the binaryTarget in the Swift package. Could someone please explain to me if it is even possible to use xcframeworks packaged in Swift packages in such cases, and if so, how to do it correctly?
0
0
46
1d
Xcode Fails to Load Products Metadata from the StoreKit Configuration File
I'm on an Intel-based Mac running macOS Sonoma 14.7.1 (23H222) and Xcode Version 16.1 (16B40). I've created a local StoreKit Configuration File that does not synchronise with App Store Connect and selected it in the Scheme. I have some products that are consumable in-app purchase and it loads fine as expected when I run the app and I am able to make transactions. It also show up in the Transaction Manager. After a little while, working on the app, re-running it several times, it stops working. The products do not load the metadata from the StoreKit configuration file. I also get this error in the console: Error enumerating unfinished transactions for first transaction listener: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={AMSStatusCode=0, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <DF5E86B0-0E4A-4982-AF42-FC58FA858C01>.<1>, NSErrorFailingURLKey=http://localhost:51027/inApps/history?guid=F01898465023&reason=initial, _kCFStreamErrorDomainKey=10, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <DF5E86B0-0E4A-4982-AF42-FC58FA858C01>.<1>" ), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=http://localhost:51027/inApps/history?guid=F01898465023&reason=initial, NSUnderlyingError=0x60000038c150 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorDomainKey=10, _kCFStreamErrorCodeKey=-72000, _NSURLErrorNWPathKey_desc=satisfied (Path is satisfied), interface: lo0, _NSURLErrorNWResolutionReportKey_desc=Resolved 0 endpoints in 0ms using unknown from query}}, _kCFStreamErrorCodeKey=-72000} Restarting the computer resolves the issue but I don't want to restart the computer every single time when it happens and it happens quite soon after a short while. How can I make sure that it doesn't happen or if it does happen then fix the issue without restarting the computer? Relaunching Xcode doesn't help and neither does deleting Project Build Data and Indexes.
0
0
40
2d
Timeout Issues with Async Polling in Xcode Cloud
Hi, Our team uses Xcode Cloud to run unit tests, and since around November, we’ve been frequently experiencing timeouts with the following type of process: @Test func hogeTest() async { // do something hoge.do() // wait until done await wait(condition: { hoge.isDone }) // test result #expect(hoge.isSucceeded) } private func wait(condition: () async -> Bool, timeout: TimeInterval = 0.5, pollingInterval: TimeInterval = 0.01) async throws { let deadline = Date().addingTimeInterval(timeout) while Date() < deadline { if await condition() { return } try await Task.sleep(nanoseconds: UInt64(round(pollingInterval * TimeInterval(NSEC_PER_SEC)))) } Issue.record("timeout") } Although sleep is supposed to wait for only a few milliseconds, there are cases where it takes more than 10 seconds, leading to a timeout. What could be causing this instability in the sleep duration? Additionally, if there are other recommended ways to implement polling and waiting in Swift Testing, I would appreciate it if you could share them. A feedback report (FB15899163) has already been submitted. Best regards,
2
0
76
2d
New linker in Command Line Tools 16 not working with BLOCK DATA
We've encountered a critical issue with the new linker of CLT16 (version 16.1.0.0.1.1729049160) that prevents proper initialization of BLOCK DATA. BLOCK DATA are used to initialize global variables in our Fortran code, and its failure to initialize those variables leads to a program crash. This affects our community of more that thousand scientists worldwide. The current workaround is using the -ld_classic linker option. However, this option is deprecated and will be removed in a future release, as described in the Xcode release note. I've attached a minimal example that reproduces the problem using GNU gfortran with the following instructions (the attached main.f.txt and bd.f.txt need to be rename to main.f and bd.f, respectively): gfortran -c bd.f gfortran -c main.f ar rv libtest.a bd.o main.o gfortran -ld_classic -o good.x -L. libtest.a gfortran -o bad.x -L. libtest.a Running the two programs, one can see that the BLOCK DATA are not initialised without the option ld_classic, $ > ./good.x 3.7273802569289098 2.8083922366048202 $ > ./bad.x 0.0000000000000000 0.0000000000000000 We kindly request your attention to this matter and a prompt solution or alternative workaround. Best regards main.f.txt bd.f.txt part.txt
0
0
112
4d
macOS Authorization Plugin: Keychain Error -25308 When Storing Password
Hi everyone, I'm working on a macOS authorization plugin (NameAndPassword) to enable users to log into their system using only MFA, effectively making it passwordless. To achieve this, I'm attempting to store the user's password securely in the Keychain so it can be used when necessary without user input. However, when I attempt to store the password, I encounter error code -25308. Below is the code I'm using to save the password to the Keychain: objc code (void)storePasswordInKeychain:(NSString *)password forAccount:(NSString *)accountName { NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *query = @{ (__bridge id)kSecClass: (__bridge id)kSecClassGenericPassword, (__bridge id)kSecAttrService: @"com.miniOrange.nameandpassword", (__bridge id)kSecAttrAccount: accountName, (__bridge id)kSecValueData: passwordData, (__bridge id)kSecAttrAccessible: (__bridge id)kSecAttrAccessibleAfterFirstUnlock }; // Delete any existing password for the account OSStatus deleteStatus = SecItemDelete((__bridge CFDictionaryRef)query); if (deleteStatus == errSecSuccess || deleteStatus == errSecItemNotFound) { [Logger debug:@"Old password entry deleted or not found."]; } else { [Logger error:@"Failed to delete existing password: %d", (int)deleteStatus]; } // Add the new password OSStatus addStatus = SecItemAdd((__bridge CFDictionaryRef)query, NULL); if (addStatus == errSecSuccess) { [Logger debug:@"Password successfully saved to the Keychain."]; } else { [Logger error:@"Failed to save password: %d", (int)addStatus]; } } Any insights or suggestions would be greatly appreciated!
3
0
169
3d
Missing required modules when enabling Swift 6
Hi team, We're using CocoaPods in our project and we noticed the compiler fails to build certain targets saying it's "Missing required module 'x'" when trying to build them in Swift 6: We realized the modules the compiler is complaining about are pod dependencies required by the other target dependencies, and that this error will only appear when building with Swift 6 unless such dependencies are described on the Podfile as direct dependencies of the target, or we include them in the framework search paths. For example, the error in the image above will show if module 'X' import 'Y' and 'Y' imports 'CocoaLumberJack' and we don't specify a direct dependency between 'X' and 'CocoaLumberJack'. Regardless of the fact that we can manually add the missing module location to the target search paths, we'd like to understand why we're facing this issue in the first place, what changed between Swift 5 and Swift 6 that's requiring us now to explicitly describe these dependencies. I'd appreciate if someone could tell us more about this. We're particularly interested on knowing if this is an intentional change and how to handle it properly. Thanks
0
0
109
4d
Un-Wanted Edit Menu Items
Xcode is adding un-wanted menu items to the Edit menu in a Mac Application. There is an automatically generated separator bar and an AutoFill menu item with two sub-menu items. Looking at the source code I see that two other items were suppressed in the initialize method of the AppController like this: NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary]; //Get rid of Special characters menu item in edit menu: [defaultValues setObject: [NSNumber numberWithBool: YES] forKey: @"NSDisabledCharacterPaletteMenuItem"]; //Get rid of Start Dictation... menu item in edit menu: [defaultValues setObject: [NSNumber numberWithBool: YES] forKey: @"NSDisabledDictationMenuItem"]; [[NSUserDefaults standardUserDefaults] registerDefaults: defaultValues]; I guessed that there would also be a key like this: @"NSDisabledAutoFillMenuItem" but adding this to the code does nothing so apparently not. I searched programming forums and posters say that you can fix this by changing the name of the Edit menu to something like (space)Edit but this doesn't work. I searcher the Developer documentation and the Archives extensively for info about these keys but of course found nothing. Control-clicking on these pops up a menu of ways to search for these but none of them find anything. Control, option and command clicking on these keys results in ”?”. I can probably get a pointer to the menu and use NSMenu’s methods to delete these but something like the above would be better. Is there any documentation about this anywhere?
1
0
102
5d
XCUITest Screen Recording
In WWDC23: Fix failures faster with Xcode test reports, the presenter showed off an Xcode feature called Automation Explorer, that allows playback of a screen recording corresponding to an XCUITest. For the life of me, I have not been able to find out how to enable/use this feature in Xcode 16. I am using Test Plans and have set the UI Testing configuration settings for Automatic Screen Capture to On, and keep all and Preferred Capture Format to Video, but am not seeing any screen recordings being produced after running the tests. Am I doing something wrong?
1
0
140
5d
ERROR: "Failed to build the scheme (APP NAME)"
Hello, I'm kinda new to Xcode and I was trying to get back to programming while I follow a course. There seemed to be a problem with the preview and it looks like there was nothing wrong with the code, at least from what I know. I can say this because the code is the default one that Xcode gives you when you start a new project. here is the error log. == PREVIEW UPDATE ERROR: SchemeBuildError: Failed to build the scheme “App” linker command failed with exit code 1 (use -v to see invocation) Link App.debug.dylib (arm64): Undefined symbols for architecture arm64: "_main", referenced from: ___debug_main_executable_dylib_entry_point in command-line-aliases-file ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) == PREVIEW UPDATE ERROR: SchemeBuildError: Failed to build the scheme “App” linker command failed with exit code 1 (use -v to see invocation) Link App.debug.dylib (arm64): Undefined symbols for architecture arm64: "_main", referenced from: ___debug_main_executable_dylib_entry_point in command-line-aliases-file ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
1
0
129
1w
Keychain issues after installing backup on new Mac
After using backup to setup my new Mac Mini my xCode App projects run ok in the Simulator but fail to Archive or Analyze with the error: "The specified item could not be found in the keychain." The item is a provisioning profile. I was able to Run, Archive and Validate these projects on my old Mac Mini just before the final backup. Are there known problems in backup of provisioning profiles or keychains? I have tried creating new profiles etc without success for several days. I'm not an expert developer so I'm hoping there is a simple solution. Please suggest the best way to resolve and/or clarify this problem.
2
0
311
5d