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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Xcode rebuilds entire project when nothing has changed
Using Xcode 15.3 on a Mac M1 with MacOS 14.5. The project consists of C++, ObjC and Swift source files. CocoaPods is used for several libraries. CMake is used to generate the build files etc.. The issue is that any time I attempt to run the application (on any iOS device), it will always rebuild from scratch, which takes a considerable amount of time for this very large project. This occurs without any changes to the project; no source code changes, no resource file changes, nothing at all. Would anyone have any idea as to why this would be happening? Is there any diagnostic information I can enable in Xcode to show me exactly what changes it has detected, or what reason it may have for doing a full rebuild?
0
0
55
1w
Multiple Xcode warning messages after Xcode 15.4 / iOS 17.5 upgrade
Ever since Xcode updated yesterday I continually get the following warning message coming up on the console, with each consecutive - and identical - message highlighted in yellow & then red. The message reads: "CoreUI: _Bool CUIValidateIdiomSubtypes(NSInteger, NSUInteger *) passed a device subtype '2752' and idiom '2':pad that are not a matching pair, subtype is not valid with given idiom. Assuming subtype should be 0 instead." The program still runs but it's rather annoying, plus I'd like to know the cause. Xcode: 15.4 / iOS (in Xcode) 17.5 Any ideas?
0
0
114
1w
Options for switching between incorporating binary and/or source code within an app
Our company is going to develop an iOS library of functionality for inclusion in several apps, some of the apps will be developed in-house and some externally. When the library is included in external apps the source code shouldn't be visible. When the library is included in internal apps, having the option to view and step through the code within the library will be invaluable for debugging. How could I set things up so that two forms of the library can be easily generated - one exposing source code and the other not. Ideally they should be capable of being incorporated within the apps in the same manner regardless of if the source code is expose or not Is that possible? I looked at Swift Packages, but it seems its for distribution of source code only, and its not possible to hide the source code. However, conversely, a framework only contains binary and no source code. Is there any other option?
0
0
82
1w
Xcode Organizer Does Not Symbolicate Crash Reports
Crash reports in Xcode Organizer are only partially symbolicated. Frames for the OS are symbolicated but the app is not. I've followed the guidance here but app frames are still not symbolicated. https://forums.developer.apple.com/forums/thread/690094 We archive, export ipa and upload our iOS app using the command line instead of with Xcode UI. Archive xcodebuild -project myproject.xcodeproj -scheme myproject -archivePath build/myproject_results.xcarchive archive Export IPA xcodebuild -exportArchive -archivePath build/myproject_results.xcarchive -exportPath ./build/ipa/ -exportOptionsPlist /path/to/ExportOptions.plist In ExportOptions.plist we set uploadSymbols to true <key>uploadSymbols</key> <true/> Upload xcrun altool --upload-app -t ios -f $ipa_path -u $appstore_connect_username -p $appstore_connect_password When inspecting the .ipa file, I see .symbols files in the Symbols folder. I verified that the UUID from our dSYM matches one of the UUID .symbols files as well. How would I fix or further debug this issue?
0
0
89
1w
How to attach to Privileged Helper as root?
We have a Privileged Helper tool that we install with SMJobBless. I would like to debug it. I've added WaitForDebugger in our helper tool launchd plist and it does wait. But I can't attach to it via Debug->Attach to Process in Xcode with error: Code: 3 Failure Reason: tried to attach to process as user 'myusername' and process is running as user 'root' I set Debug process as: root in scheme settings. But I'm not sure if it does anything since I'm not running this particular scheme at the moment of attach. I tried unsuccessfully to set "Wait for the executable to be launched" but I had to create a new scheme for it since helper is built as part of the main app so maybe I did something wrong. Am I doing something wrong or is it not possible to attach to root process?
1
0
128
1w
Unreal 5.3 build failed, copied project from windows pc
I am having problems building an Unreal project in Xcode. The problem starts when the compiler starts to build a custom made plugin, that works perfectly fine on windows. When looking at the log, it seems that I will have to rebuild the plugin for macOS-arm64, does anyone have some ideas how I should approach? Showing All Messages ------ Building 4 action(s) started ------ [1/4] Link [Apple] Trancendent Undefined symbols for architecture arm64: "ExampleLibraryFunction()", referenced from: FTrancendantMetaNodesModule::StartupModule() in Module.TrancendantMetaNodes.cpp.o ld: symbol(s) not found for architecture arm64 /Users/Shared/Epic Games/UE_5.3/ld:1:1: ignoring file /Users/nicolaslefevre/Desktop/KanuziTemple/Plugins/TrancendantMetaNodes/Source/ThirdParty/TrancendantMetaNodesLibrary/Mac/Release/libExampleLibrary.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 Total time in Parallel executor: 2.18 seconds Total execution time: 2.95 seconds /Users/Shared/Epic Games/UE_5.3/clang:1:1: linker command failed with exit code 1 (use -v to see invocation)
0
0
120
1w
Xcode 15.4 import error: 'No such module' Error in multiple files (disregard prior post)
I'm encountering a persistent "No such module" error in Xcode 15. The error appears in one file at a time, but the behavior is unusual. Here's what happens: The error initially points to a missing module in a specific file (e.g., POILoader.swift) If I remove the line (or even comment out the import statement, the error jumps to another file (PlaceOfInterestAnnotationView swift) that also imports the same module. We've attempted to troubleshoot using common solutions like checking file paths, build settings, and cleaning the project. We tried creating a custom xcconfig file to manage build settings, as well as an objective c bridging header file but the documentation on Apple's developer site seemed outdated for Xcode 15, making it difficult to complete. I've even started from scratch in a new project and rebuilt completely. The error says "No such module 'PlaceOfInterestDefinition'. I've even created a new project and rebuilt the project. The app that will show places of interest on a map- but only the ones that are open when the user is using the app- these are two files that I'm working on that will determine whether or not to put the locations in the json file in the mapview at a specific time. POILoader.swift PlaceOfInterestDefinition.swift
0
0
80
1w
Issue with localizable.strings file not found during archiving
I'm encountering the following error while attempting to archive my app: unable to read input file: fopen({~}/Library/Developer/Xcode/DerivedData/{project name}-gxaapsrbutxnmwderhyslgnfznrl/Build/Intermediates.noindex/ArchiveIntermediates/{project name}/IntermediateBuildFilesPath/{project name}.build/Release-iphoneos/{project name}.build.lproj/Localizable.strings, rb): No such file or directory (2) (in target '{project name}' from project '{project name}') I've anonymized {project name} and {~} in the path for privacy reasons. It seems like the error pertains to not finding the localizable.strings file. Prior to encountering this error, I made the following modifications: Originally, my project used the legacy localizable.strings for localization, but I recently switched to using a string catalog. I added 8 additional languages alongside the existing Base, English, and Korean. I'm writing into the new Localizable.xcstrings file using some python scripts. When I open it in Xcode after pasting, all rows appear correctly. This error occasionally occurred even when I 'run' the app, but clearing derived data and cleaning the build folder resolved it temporarily. However this error happens always when I try to 'archieve' this. Despite copying the project due to difficulty resolving the issue within the project itself, I'm still encountering the same problem. Below are the Build Setting and Build Phases configurations: Build Phases > Compile Sources and Link Binary with Libraries do not include localizable.strings. Build Settings > Localization is set to "Yes" for all. I've tried various methods found online without success, and similar cases are scarce. Please help me resolve this issue.
1
0
93
1w
Type 'Bundle' has no member 'module'
Xcode Version 15.4 (15F31d), macOS 14.5 (23F79) When I build my app for release I get the error: /Users/danielplatt/Library/Developer/Xcode/DerivedData/DIY_Hypnotism-efkmikwjjzlodvbfszkzazwuwwtk/Build/Intermediates.noindex/DIY Hypnotism.build/Release/DIY Hypnotism.build/DerivedSources/GeneratedAssetSymbols.swift:16:48 Type 'Bundle' has no member 'module' I have no idea why this is happening. It only happens with a release build. Debug builds and runs correctly. Any insight would be appreciated.
1
0
65
1w
Build XCFramework from source that has dependencies on Swift Packages
I’m looking into building a closed source XCFramework from a local Swift package that has dependencies on other packages, which can later be distributed via Swift Package Manager. In initial discussions, we thought xcodebuild does not support linking the dependencies externally, it always includes them statically in the built framework. It's my understanding this is because we're asking xcodebuild to build a framework from a local Swift Package. Is there another way this can be achieved? To explain in more detail: I have built a closed source SDK for other developers to integrate in their apps, currently distributed as an XCFramework. The interesting thing about the SDK is it has dependencies on other libraries, which need to be resolved when adding this SDK as a dependency to an app. The SDK’s dependencies should not be baked into our XCFramework. CocoaPods has worked well for that but we want to instead use SPM. The current project setup is an iOS framework Xcode project and an app Xcode workspace. The framework project is included in the app workspace and is in the same repo as the app, which allows me to modify the framework source code then run the app to test it. The framework project can also be opened independently and built to verify it doesn’t have any errors, but to verify it’s working I run it with the app. To distribute a new release I use xcodebuild to create an XCFramework and then deploy that. For this to work with CocoaPods I had to add a Podfile to the app directly as well as the framework directory so both have the dependencies available. This means I have an xcworkspace for the framework and not just a xcodeproj. I specify the framework workspace file in the xcodebuild command. To switch to a setup that utilizes Swift Package Manager, I created a Package.swift in the iOS framework project’s directory that specifies its dependencies, removed CocoaPods integration including deleting the workspace file, removed the framework project from the app’s workspace, added the Package as a local package to the app project, and added the framework directory via + > Add Files to “App” which adds the package to the top of the sidebar, making its source code available to edit within the app workspace. Everything is working when I run the app. Xcode properly resolves the dependencies for the local package and I can run the app to develop it. Now to create an XCFramework I run the following command in the framework directory (which contains the Package.swift): xcodebuild archive -workspace . -scheme FrameworkName -configuration Release -destination 'generic/platform=iOS' -archivePath './build/FrameworkName.framework-iphoneos.xcarchive' SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES ENABLE_USER_SCRIPT_SANDBOXING=NO This succeeds however the dependencies have been linked statically thus included in our SDK. We need to only include the code from our framework and link to external dependencies, like it does with our current CocoaPods setup. I'm wondering what options there are to achieve this. Even if I need to change the project setup locally, for example to continue using a framework project/workspace instead of a local Swift package. It seems I just need xcodebuild to be able to create an XCFramework which can then be distributed with its own Package.swift file that specifies its dependencies. If it's not possible to link the dependencies externally, could you help me to understand the implications of including them statically? I don't know what problems could arise as a result of that or other concerns this would bring. Thanks!
1
1
178
1w
Xcode 15.4 import error: 'No such module' Error in multiple files
I'm encountering a persistent "No such module" error in Xcode 15. The error appears in one file at a time, but the behavior is unusual. Here's what happens: The error initially points to a missing module in a specific file (e.g., POILoader.swift) If I remove the line (or even comment out the import statement, the error jumps to another file (PlaceOfInterestDefinition.swift) that also imports the same module. We've attempted to troubleshoot using common solutions like checking file paths, build settings, and cleaning the project. Additional Information: We tried creating a custom xcconfig file to manage build settings, but the documentation on Apple's developer site seemed outdated for Xcode 15, making it difficult to complete. The error says "No such module 'PlaceOfInterestModule'. POILoader.swift PlaceOfInterestDefinition.swift I've even created a new project and rebuilt the project. I'm working on an app that will show places of interest on a map- but only the ones that are open when the user is using the app- these are two files that I'm working on that will determine whether or not to put them in the mapview or not.
1
0
118
1w
Xcode 16 Beta: Predictive Code Completion failing to install
I am getting the following error when installing Xcode 16 Beta: The operation couldn’t be completed. (ModelCatalog.CatalogErrors.AssetErrors error 1.) Domain: ModelCatalog.CatalogErrors.AssetErrors Code: 1 User Info: { DVTErrorCreationDateKey = "2024-06-20 20:18:46 +0000"; } Failed to find asset: com.apple.fm.language.code_safety_guardrail.base - no asset Domain: ModelCatalog.CatalogErrors.AssetErrors Code: 1
1
0
158
1w
xcodebuild destination for any mac
I have a script that has not been updated in a while that compiles my application using xcodebuild. I'm getting this warning which leads me to believe that it's only building the first destination. But when I check the binary with lipo -archs it shows has having both; which I want. --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:macOS, arch:arm64, id:00006021-001071911ABBC01E, name:My Mac } { platform:macOS, arch:x86_64, id:00006021-001071911ABBC01E, name:My Mac } First, why the warning if I'm trying to build a Universal binary, and can I turn this off. Or should I leave it? Thanks!
1
0
100
1w
No Apple plug-in library path found
Hey! I'm facing a problem I have 0 idea how to solve it. I'm building a project with Unity 2022.3.21 for visionOS and after a lot of exhausting problems I'm having the last one, I am kinda new to Xcode. I get the error "No Apple plug-in library path found", at the root of the project there Xcode should find the ApplePluginLibraries folder, and it's actually there with two folders inside Apple.Core and Apple.GameKit. Xcode is saying the path was not found and I can see it exists through finder. In Search Paths > Framework Search Paths I have: $(PROJECT_DIR)/ApplePluginLibraries/Apple.GameKit $(PROJECT_DIR)/ApplePluginLibraries/Apple.Core Also in Other Linker Flags I have: -L$(PROJECT_DIR)/ApplePluginLibraries/Apple.GameKit -L$(PROJECT_DIR)/ApplePluginLibraries/Apple.Core I was having a few errors and the last one is: Command PhaseScriptExecution failed with a nonzero exit code, and the description says about the path not found. My info: MacOS: Apple M1 Pro Sonoma 14.5 Xcode: 15.4 Unity: 2022.3.21f1 Any idea? Thanks!!
0
1
99
1w
Gaps in Xcode build timeline
Reposting (after a while) from the Swift forums - the build timeline for our project has a lot of weird gaps in the beginning - almost 15 seconds in total, which is quite a big chunk of the total build time. Is there any way to determine why they exist or how I could fix them? I hope it's just something hidden and not the build system literally doing nothing... This is on Xcode 15.4.
0
0
95
1w
SwiftData with CloudKit freezing previews in Xcode 16 beta
To reproduce: In Xcode, create a new project with SwiftData storage Add a new item in the preview — everything works fine so far Enable CloudKit sync for the target (add iCloud capability, check CloudKit, add a container) Go back to the preview and add a new item — Xcode will now freeze As soon as you modify the SwiftData storage, the preview freezes and the Xcode app becomes extremely slow until you either refresh the preview or restart Xcode.
0
0
89
1w