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

Unable to build complex Mac app project with 8 targets since upgrading to Mac OS Sequoia
I have a complex project that used to compile without any problems that i could not solve before I bought a new iMac (the latest, M4), which came with macOS Sequoia. I've ben able to compile the whole project since 1998, which has evolved into an AppKit Mac app written almost completely in Swift. I am also able to compile this project on Xcode 16.1 on MacOS Sonoma. However, since I upgraded to MacOS Sequoia, I am stumped with lots of errors that I don't know how to fix. Many of them are related to new build system, which works fine in smaller projects I have written, but it completely breaks when I use this more complex project. I've been unable to create a focused project so I can file a DTS incident, because when I try to recreate it in a new, more focused project, the problem goes away. I tried to transfer the code to a freshly created project, and I was able to make it build again without errors, but then this new project just creates empty bundles without any resources and executables in them. In almost 25 years of experience in coding, I've never encountered such huge problems with just a MacOS upgrade. I would like to have some guidance on how to proceed. Here is an example of the errors I'm getting: error: unable to write file '/SchIS64.build/Objects-normal/arm64/SchIS64.LinkFileList': fopen(/SchIS64.build/Objects-normal/arm64/SchIS64.LinkFileList, wb): No such file or directory (2) (in target 'SchIS64' from project 'Scheduler (Cocoa)') WriteAuxiliaryFile /SchIS64.build/unextended-module.modulemap (in target 'SchIS64' from project 'Scheduler (Cocoa)') cd /Users/admin/Documents/Development/Scheduler/Scheduler write-file /SchIS64.build/unextended-module.modulemap WriteAuxiliaryFile /SchIS64.build/unextended-module-overlay.yaml (in target 'SchIS64' from project 'Scheduler (Cocoa)') cd /Users/admin/Documents/Development/Scheduler/Scheduler write-file /SchIS64.build/unextended-module-overlay.yaml WriteAuxiliaryFile /SchIS64.build/SchIS64.hmap (in target 'SchIS64' from project 'Scheduler (Cocoa)') cd /Users/admin/Documents/Development/Scheduler/Scheduler write-file /SchIS64.build/SchIS64.hmap
3
0
133
5d
Download & replace app container
I used to download and replace the app container when I was testing, essentially downloading the container from the live app, and restoring it into the test app in order to not affect the live app, but to test major changes on "live" data. it seems the option for downloading and replacing in Xcode no longer works, I will sometimes get a container downloaded, other times it only part downloads. I can never seem to get it to replace. No errors, but it doesn't work on the new device. It used to be that devices & simulators showed when it was downloading and replacing but it no longer does that. Is there another way of doing this? Currently I'm having to take a backup of the live phone, restore on the test device, then delete all the unneeded apps, otherwise the restore takes ages, then backup the test device and restore every time I need to restart.
0
1
90
1w
Xcode simulator & preview not loading
Hello, I recently decided to start learning how to code for iOS. I don't have much coding experience but I still wanted to explore it for fun at least. I downloaded Xcode on my Macbook, and opened a new iOS file after downloading iOS 18.1 so I could run the simulator/get a preview of my code. Even though I only had the basic "Hello World!" that is auto-generated in my code, the preview would never show and sat at a loading screen for multiple hours, saying "Preparing (Automatic) iPhone Simulator" at the top. There is probably a simple solution that I'm missing. I would appreciate any tips! Thanks.
1
0
110
1w
Memory leak when using OSLogStore in a loop
Hello, I am currently working on a project that involves periodically querying OSLog to forward system log entries to a backend. While the functionality generally operates as expected, I have encountered a memory leak in my application. Through testing, I have isolated the issue to the following simplified code example: #import <Foundation/Foundation.h> #import <OSLog/OSLog.h> int main(int argc, const char * argv[]) { @autoreleasepool { while(1) { NSError *error = nil; OSLogStore *logStore = [OSLogStore storeWithScope:OSLogStoreSystem error:&error]; if (!logStore) NSLog(@"Failed to create log store: %@", error); sleep(1); } } return 0; } When running this example, the application exhibits increasing memory usage, consuming an additional 100 to 200 KB per iteration, depending on whether the build is Debug or Release. Given that Automatic Reference Counting is enabled, I anticipated that the resources utilized by logStore would be automatically released at the end of each iteration. However, this does not appear to be the case. Am I using the API wrong? I would appreciate any insights or suggestions on how to resolve this issue. Thank you.
2
0
117
6d
cd on terminal
When I'm in TERMINAL and I issue the cd command it says no such file or directory. I cut this from the terminal session: Last login: Tue Nov 12 20:10:57 on ttys000 The default interactive shell is now zsh. To update your account to use zsh, please run chsh -s /bin/zsh. For more details, please visit https://support.apple.com/kb/HT208050. iMac:~ robertsantovasco$ cd desktop iMac:desktop robertsantovasco$ cd L1 demo -bash: cd: L1: No such file or directory iMac:desktop robertsantovasco$ cd L1 -bash: cd: L1: No such file or directory iMac:desktop robertsantovasco$ cd L1 demo -bash: cd: L1: No such file or directory iMac:desktop robertsantovasco$ cd / iMac:/ robertsantovasco$ cd desktop -bash: cd: desktop: No such file or directory iMac:/ robertsantovasco$ cd L1 demo -bash: cd: L1: No such file or directory iMac:/ robertsantovasco$ cd L1 demo -bash: cd: L1: No such file or directory iMac:/ robertsantovasco$ cd desktop -bash: cd: desktop: No such file or directory iMac:/ robertsantovasco$ cd desktop -bash: cd: desktop: No such file or directory iMac:/ robertsantovasco$ CD desktop /usr/bin/CD: line 4: cd: desktop: No such file
5
0
152
5d
AttributeGraph: AG::Graph::update_main_refs(AG::AttributeID)
Hello, I recently have crashes on my application, it results in many crashes with different reasons, here are the different main reasons: AttributeGraph: AG::Graph::update_main_refs(AG::AttributeID) SwiftUICore: closure #1 in ViewLayoutEngine.explicitAlignment(_:at:) SwiftUICore: __swift_instantiateGenericMetadata My main problem is that these crashes appeared without any major changes to my app, and they never happen when I emulate the app from xcode whether on a simulator or a real device. I have other crashes with other errors I can provide them if necessary. So I have a lot of trouble identifying where the errors come from, I tried to activate zombie objects, and address sanitizer without it revealing anything. Thanks in advance for the answers.
0
0
133
1w
Run identical UI/Unit tests on different build targets
I have different versions of my iOS App (written in SwiftUI). The app on the store, the App Clip, and one or two next version apps not yet released (e.g. A/B comparison). All good. But now I've started creating UI and Unit tests and I'm confused about how to get this working. Each build target has its own scheme. And in that scheme I have a Test plan for that target. E.g. The App Clip scheme has an App Clip test plan. Since all the app variants are very similar, I only have one set of unit tests and one set of UI tests so each test plan includes the same unit test target and the UI test target. Problem: When I selected a scheme (e.g. for the App Clip) and ran the tests, it turned out that all the tests ran for another build target, not the target of the scheme. I think this might be because within the definition of the test target there's a field specifying the host application. I.e. the build target. Question: How can I set up my project so that the test plan uses the relevant target build? Or do I have to duplicate all the test targets (one for each target)? Or do I have to manually change each test target before running it for a particular build target?
1
0
115
5d
Xcode 16 missing the DeviceSupport for iOS17 and above
i am unable to deploy the iOS app with automation using below command: ios-deploy --bundle /Users/XXXX/Library/Developer/Xcode/DerivedData/iOSClient2-XXXXXXX/Build/Products/Debug-iphoneos/iOSClient2.app/ --id 00008020-XXXXXXXXX --justlaunch --verbose with the error: ------ Debug phase ------ Starting debug of 00008120-000C713236E0A01E (D38AP, D38AP, uknownos, unkarch, 18.1, 22B83) a.k.a. 'Svt’s iPhone' connected through USB... Device Class: iPhone build: 22B83 version: 18.1 Found Xcode developer dir /Applications/Xcode.app/Contents/Developer version: 18.0 version: 18 2024-11-08 15:26:09.531 ios-deploy[33496:644410] [ !! ] Unable to locate DeviceSupport directory with suffix 'DeveloperDiskImage.dmg'. This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown! Observation: Xcode 16 missing the DeviceSupport for iOS17 and above. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/.... Xcode: Version 16.1 (16B40 iOS: iOS17 and above
0
0
94
1w
Xcode 16 destroys Objective-C Developer Documentation
In Xcode 16, even if Objective-C is selected, the Navigator in the documentation viewer displays Swift information. I don't know when this bug was introduced, but it's there in the last Xcode 16 betas at least. I hope as many developers as possible submit this bug to Apple to get their attention. P.S. Yes, I know there's Dash. For many years, Dash was a much better option than Xcode's built-in viewer. However, in version 5, the Dash developer introduced some unfortunate UI changes that made Xcode a better option to view the documentation in certain cases. Unfortunately, the Dash developer doesn't seem to be interested in user feedback anymore. He's been ignoring suggestions and user requests for years by now.
4
0
158
1w
Location Error
I started getting a location error recently. I've never seen this error before and it began happeing randomly. Here is the breakpoint. (if let locationManager........) var currentLocation: Result<CLLocation, Error> { get { #if DEBUG return .success(CLLocation(latitude: CLLocationDegrees(exactly: 0)!, longitude: CLLocationDegrees(exactly: 0)!)) #else if let locationManager = self.locationManager { return locationManager.currentLocation } return .failure(LocationError.unknown) #endif } } I've tried everything I can think of to fix the issue. It has an issue getting the users location when logging in. I've made no changes to the code and everything has worked for years. The bug reports show nothing. I've tried re-installing Xcode, rebuilding the pods etc. I've tried everything that you would normally do in this situation.
1
0
166
1w
Elementos no responden a un toque xcode
Desarrolle una app en xcode 16 para version minima de ios 16, todo funcionaba bien hasta la version 17 de ios, pero para ios 18 empezaron los problemas, los botones no responden a un toque, se deben sostener con un toque largo para que funcionen, ahora de un momento a otro ya no funciona para ninguna version de ios, los eventos tactiles deben ser prolongados para que se activen, en los botones o elementos que usan el tapgesture, he probado de todo versiones de xcode, versiones de swiftui, dispostivos reales, emuladores de todo y nada funciona, algun consejo o solucion gracias
0
0
113
1w
My new provisioning profiles are broken
I've updated Xcode to 16.1, then I've created a new provisioning profile in developer.apple.com, successfully built and signed my application. It was on monday, 2024-11-04. Two or three days later I was asked to add more devices and I had to create a new profile. I've noticed a new feature to control profile's name (yeah, cool!), had to accept new agreements. Then, have created a new profile, downloaded it, but could not add it with double-click to Xcode or import to Keychain Access - "Failed to install one or more provisioning profiles on the device". And whatever I tried, I couldn't register any new profiles since. Therefore, my app cannot be signed and tested anymore. This is quite weird as nothing has changed on the system throughout the week. Is this a known issue or is there any fix for that?
3
0
284
1w
On Xcode16, when using the xcodebuild command to package, the developer account will be logged out, and then the packaging will fail.
Our CI process uses XcodeBuild tools. It used to work very well. The shell code is as follows: step 1 "++++++++++++++++clean++++++++++++++++" xcodebuild clean -workspace ${WORKSPACE_NAME}.xcworkspace \ -scheme ${SCHEME_NAME} \ -configuration ${configuration} step 2 "+++++++++++++++++archive+++++++++++++++++" xcodebuild archive -workspace ${WORKSPACE_NAME}.xcworkspace \ -scheme ${SCHEME_NAME} \ -configuration ${configuration} \ -archivePath ${ARCHIVE_PATH} -allowProvisioningUpdates YES step 3 "+++++++++++++++++ipa+++++++++++++++++" xcodebuild -exportArchive \ -archivePath ${ARCHIVE_PATH} \ -exportPath "${IPA_PATH}" \ -exportOptionsPlist ${EXPORT_METHOD_PLIST_PATH} \ -allowProvisioningUpdates YES But after upgrading to xcode16, every time I execute the step3, it fails. The error log is like this ** ARCHIVE SUCCEEDED ** 2024-11-08 16:19:54.360 xcodebuild[36487:6743710] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/ch/1mvd9gz11cn8zy9h254qz2600000gn/T/***.xcdistributionlogs". error: exportArchive No Accounts error: exportArchive Provisioning profile "iOS Team Store Provisioning Profile: com.***" doesn't include signing certificate "Apple Distribution: *** Co Ltd (***)". ** EXPORT FAILED ** At this time, my Apple developer account disappeared in xcode-setting-account, and it automatically logged out. If I log in again and execute the shell command, the above phenomenon will reappear. What is the cause of this, and what do I need to do to solve this problem? I look forward to your reply
2
0
251
1w
Landscape safe area is incorrect when presenting SKStoreProductViewController
Hi. If the app is in landscape only and when the SKStoreProductViewController is presented, the safeArea changes to what looks like a portrait mode safe area. When the SKStoreProductViewController is dismissed, the safeArea does NOT revert back to the original values. Is there a way to force the safeArea to "reset"? I've submitted some bug tickets through Apple Feedback but I haven't received any response about it. The below code will pop up the SKStoreProductViewController and if you have a UIView that is constrained to the safe area, then you can visibly notice that the safe area is changed and doesn't go back. I have tested this on iPhone 14 Pro, iPhone 15, and iPhone 16 Pro and in the Simulators. The incorrect behavior happens on those and probably more. Thanks. #import "ViewController.h" #import &amp;lt;StoreKit/StoreKit.h&amp;gt; @interface ViewController () @property (nonatomic, strong) SKStoreProductViewController *productViewController; @end @implementation ViewController - (IBAction)buttonTapped:(id)sender { self.productViewController = [[SKStoreProductViewController alloc] init]; NSDictionary *parameters = @{ @"id" : @"6443575749" }; [self.productViewController loadProductWithParameters:parameters completionBlock:^(BOOL result, NSError * _Nullable error) { [self presentViewController:self.productViewController animated:YES completion:^{ // presented // The panel that is constraint to the safe area visibly shows that the safe area is no longer correct. }]; }]; } @end
0
1
182
1w
App that runs fine under Xcode 15 does not work on Xcode 16.
When I upgraded to Sequoia 15.1, an app that worked fine under OS 14 stopped working. Out of 4 views on the main screen, only 1 is visible. Yet, if I click where another view should be, I get the expected action so the views are there, just not visible. Only I can't see where I am clicking! I had to upgrade to Xcode 16 to recompile the app and run it in Debug mode. When I do, I get the following: NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed. Can't find or decode disabled use cases. applicationSupportsSecureRestorableState FWIW - the only view that actually shows up is the last subview added to the main view.
1
0
215
1w