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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Crash in Widget extension
Hi everyone! I'm seeking help to understand crashes that, as I can see, come from the widget extension. The brief stack trace that I can see under Xcode -> Window -> Organizer -> [My App] -> Crashes is pretty short (see attachment). My widgets do fetch request to Core Data, but the operation is performed on the background thread and data is lightweight. I have been debugging for days, but haven't found any weak code blocks that might take too much memory or crash due to simple language issues. Will appreciate any help! In the crash report file, I see the following logs (highlight a few of them due to lines limit): Incident Identifier: 62A28083-43EE-47F2-A2E0-89A1FA89744A Hardware Model: iPhone13,2 Process: MyAppWidgetsExtension [28359] Identifier: MyAppWidgets Version: 2.16.0 (290) OS Version: iPhone OS 17.4.1 (21E236) Exception Type: EXC_CRASH (SIGKILL) Termination Reason: RUNNINGBOARD 0xdead10cc Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000001e05c5af8 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001e05c5890 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000001e05c57a8 mach_msg_overwrite + 436 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000001e05c55e8 mach_msg + 24 (mach_msg.c:323) 4 CoreFoundation 0x00000001980a001c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624) 5 CoreFoundation 0x000000019809df04 __CFRunLoopRun + 1208 (CFRunLoop.c:3007) 6 CoreFoundation 0x000000019809d968 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420) 7 Foundation 0x0000000196f2c4a8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373) 8 Foundation 0x0000000196f2aff0 -[NSRunLoop(NSRunLoop) run] + 64 (NSRunLoop.m:398) 9 libxpc.dylib 0x00000001f40aa26c _xpc_objc_main + 336 (main.m:267) 10 libxpc.dylib 0x00000001f40ac7e4 _xpc_main + 64 (init.c:1294) 11 libxpc.dylib 0x00000001f40ac7a4 xpc_bs_main + 16 (init.c:1310) 12 BoardServices 0x00000001b0d38240 +[BSServicesConfiguration activateXPCService] + 68 (BSServicesConfiguration.m:113) 13 ExtensionFoundation 0x00000001a70bbdf0 -[_EXRunningExtension resume] + 260 (EXRunningExtension.m:298) 14 ExtensionFoundation 0x00000001a70bbc38 -[_EXRunningExtension startWithArguments:count:] + 396 (EXRunningExtension.m:269) 15 ExtensionFoundation 0x00000001a70cfa30 EXExtensionMain + 220 (EXExtensionMain.m:34) 16 Foundation 0x0000000197665ed4 NSExtensionMain + 204 (NSExtensionMain.m:21) 17 dyld 0x00000001bb5bed84 start + 2240 (dyldMain.cpp:1298) Thread 2: 0 libsystem_kernel.dylib 0x00000001e05d381c guarded_pwrite_np + 8 (:-1) 1 libsqlite3.dylib 0x00000001c1ddc158 seekAndWrite + 456 (sqlite3.c:44255) 2 libsqlite3.dylib 0x00000001c1d95908 unixWrite + 180 (sqlite3.c:44333) 3 libsqlite3.dylib 0x00000001c1de4574 pagerWalFrames + 868 (sqlite3.c:66940) 4 libsqlite3.dylib 0x00000001c1d95628 sqlite3PagerCommitPhaseOne + 316 (sqlite3.c:70256) 5 libsqlite3.dylib 0x00000001c1d85d7c sqlite3BtreeCommitPhaseOne + 172 (sqlite3.c:80934) 6 libsqlite3.dylib 0x00000001c1d85944 vdbeCommit + 1136 (sqlite3.c:93952) 7 libsqlite3.dylib 0x00000001c1d5ec74 sqlite3VdbeHalt + 1352 (sqlite3.c:94362) 8 libsqlite3.dylib 0x00000001c1d7fd04 sqlite3VdbeExec + 42952 (sqlite3.c:103728) 9 libsqlite3.dylib 0x00000001c1d74c80 sqlite3_step + 964 (sqlite3.c:97699) 10 CoreData 0x00000001a01ba0e0 _execute + 128 (NSSQLiteConnection.m:4573) 11 CoreData 0x00000001a01e5510 -[NSSQLiteConnection commitTransaction] + 596 (NSSQLiteConnection.m:3250) 12 CoreData 0x00000001a040aac0 _executeBatchUpdateRequest + 1216 (NSSQLCore_Functions.m:1110) 13 CoreData 0x00000001a030a240 -[NSSQLBatchUpdateRequestContext executeRequestCore:] + 32 (NSSQLBatchUpdateRequestContext.m:88) 14 CoreData 0x00000001a01c8508 -[NSSQLStoreRequestContext executeRequestUsingConnection:] + 252 (NSSQLStoreRequestContext.m:183) 15 CoreData 0x00000001a01c82b4 __52-[NSSQLDefaultConnectionManager handleStoreRequest:]_block_invoke + 60 (NSSQLConnectionManager.m:302) 16 CoreData 0x00000001a01c81ec __37-[NSSQLiteConnection performAndWait:]_block_invoke + 48 (NSSQLiteConnection.m:733) 17 libdispatch.dylib 0x000000019ff66dd4 _dispatch_client_callout + 20 (object.m:576) 18 libdispatch.dylib 0x000000019ff762c4 _dispatch_lane_barrier_sync_invoke_and_complete + 56 (queue.c:1100) 19 CoreData 0x00000001a01de8d0 -[NSSQLiteConnection performAndWait:] + 176 (NSSQLiteConnection.m:730) 20 CoreData 0x00000001a019d094 -[NSSQLDefaultConnectionManager handleStoreRequest:] + 248 (NSSQLConnectionManager.m:297) 21 CoreData 0x00000001a019cf64 -[NSSQLCoreDispatchManager routeStoreRequest:] + 228 (NSSQLCoreDispatchManager.m:60) 22 CoreData 0x00000001a019cd68 -[NSSQLCore dispatchRequest:withRetries:] + 172 (NSSQLCore.m:3975) 23 CoreData 0x00000001a01bc034 -[NSSQLCore executeRequest:withContext:error:] + 1208 (NSSQLCore.m:2951) 24 CoreData 0x00000001a01d06a0 __65-[NSPersistentStoreCoordinator executeRequest:withContext:error:]_block_invoke.541 + 4156 (NSPersistentStoreCoordinator.m:2994) 25 CoreData 0x00000001a01cf57c -[NSPersistentStoreCoordinator _routeHeavyweightBlock:] + 264 (NSPersistentStoreCoordinator.m:641) 26 CoreData 0x00000001a01abc48 -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1048 (NSPersistentStoreCoordinator.m:2768) 27 CoreData 0x00000001a018bbdc -[NSManagedObjectContext executeRequest:error:] + 700 (NSManagedObjectContext.m:2044) 28 CoreData 0x00000001a0265be8 __116+[NSCKRecordMetadata batchUpdateMetadataMatchingEntityIdsAndPKs:withUpdates:inStore:withManagedObjectContext:error:]_block_invoke + 128 (NSCKRecordMetadata.m:744) 29 CoreFoundation 0x000000019806dfb4 __NSDICTIONARY_IS_CALLING_OUT_TO_A_BLOCK__ + 24 (NSDictionaryHelpers.m:10) 30 CoreFoundation 0x000000019806de2c -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 288 (NSDictionaryM.m:271) 31 CoreData 0x00000001a0265970 +[NSCKRecordMetadata batchUpdateMetadataMatchingEntityIdsAndPKs:
1
0
24
1h
Not able to deploy apps to simulator using XCode 15.0 and 15.4
I am getting error after XCode build completes in the simulator. Not able to install app in any simulator. Getting a popup with title LLDB provided no error string. and on tapping more details getting below error Domain: IDEDebugSessionErrorDomain Code: 3 Failure Reason: LLDB provided no error string. User Info: { DVTErrorCreationDateKey = "2024-06-24 09:28:54 +0000"; DVTRadarComponentKey = 855031; IDERunOperationFailingWorker = DBGLLDBLauncher; RawUnderlyingErrorMessage = "LLDB provided no error string."; } -- Could not launch <AppName> Domain: IDEDebugSessionErrorDomain Code: 3 Failure Reason: LLDB provided no error string. User Info: { DVTRadarComponentKey = 855031; IDERunOperationFailingWorker = DBGLLDBLauncher; RawUnderlyingErrorMessage = "LLDB provided no error string."; } -- Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_model" = "iPhone14,6"; "device_osBuild" = "17.5 (21F79)"; "device_platform" = "com.apple.platform.iphonesimulator"; "dvt_coredevice_version" = "355.28"; "dvt_mobiledevice_version" = "1643.100.60"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 7177; "operation_errorCode" = 3; "operation_errorDomain" = IDEDebugSessionErrorDomain; "operation_errorWorker" = DBGLLDBLauncher; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphonesimulator"; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 0; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 0; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 0; "param_launcher_substyle" = 0; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphonesimulator17.5"; "sdk_osVersion" = "17.5"; "sdk_variant" = iphonesimulator; } -- System Information macOS Version 14.4.1 (Build 23E224) Xcode 15.4 (22622) (Build 15F31d) Timestamp: 2024-06-24T14:58:54+05:30
0
0
8
2h
Xcode 16 Beta constantly crashing
Hey, I updated to the macOS beta 15 and downloaded Xcode 16. For a while it was working - then I tried to open a project, and Xcode crashed. From that point on I am unable to open any project with Xcode. I can't even create new apps - its crashing when trying to do that. I can't open the organiser, or anything. Does anyone know how to make full Xcode reset? I already deleted the DerivedData, deleted and downloaded the Xcode app but to no avail. The crash stack looks like that: Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: Xcode [96603] Application Specific Information: abort() called Application Specific Signatures: ((accountCredentials)) != nil Thread 0 Crashed: 0 libsystem_kernel.dylib 0x18662d5e0 __pthread_kill + 8 1 libsystem_pthread.dylib 0x186665f70 pthread_kill + 288 2 libsystem_c.dylib 0x186572908 abort + 128 3 IDEKit 0x109fd2810 +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 968 4 IDEKit 0x109fd2c50 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] + 872 5 DVTFoundation 0x10630af24 _DVTAssertionHandler + 424 6 DVTFoundation 0x10630b0a4 _DVTAssertionFailureHandler + 196 7 DVTFoundation 0x1063242e0 +[DVTAppleIDBasedDeveloperAccount accountWithCredentials:] + 240 8 DVTFoundation 0x106323210 +[DVTDeveloperAccount accountWithUsername:alternateDSID:token:] + 388 9 DVTFoundation 0x1062acffc -[DVTDeveloperAccountManager _accountsByCreatingFromDefaults] + 772 10 DVTFoundation 0x1062ada8c __41-[DVTDeveloperAccountManager allAccounts]_block_invoke + 40 11 libdispatch.dylib 0x1864b36d8 _dispatch_client_callout + 20 12 libdispatch.dylib 0x1864c2d30 _dispatch_lane_barrier_sync_invoke_and_complete + 56 13 DVTFoundation 0x10634b7c4 DVTDispatchBarrierSync + 148 14 DVTFoundation 0x106327190 -[DVTDispatchLock performLockedBlock:] + 60 15 DVTFoundation 0x1062ad9fc -[DVTDeveloperAccountManager allAccounts] + 124 16 DVTFoundation 0x1062ad948 -[DVTDeveloperAccountManager loadAccountsWithCallback:] + 44 17 XcodeCloudKit 0x11b84669c DeveloperAccountObserver.startObserving() + 464 18 XcodeCloudKit 0x11b758f50 Session.startEffects<A>(workspace:) + 660 19 XcodeCloud 0x1138c52bc closure #1 in static ToolbarItemProvider.item(forItemIdentifier:forToolbarIn:) + 72 20 XcodeCloud 0x1138c47bd partial apply for specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 21 XcodeCloud 0x1138c6b2d specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 22 XcodeCloud 0x1138c47bd partial apply for specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 23 libswift_Concurrency.dylib 0x25dd69921 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1 }
0
1
4
4h
App Intent snippet view does't able to fetch color for xcassets.
We have an existing app in which we have implemented AppShortcuts. The snippet view works fine in iOS 17 while in iOS18 beta, it doesn't able to fetch color from xcassets. If we use system colours or UIColor it's working fine. Not working Color("progressColor") Working Color(uiColor: UIColor(named: "progressColor")!) Color.red Color(hex: "3881d3") // Note: We created Color extension to generate color from hex string.
0
0
44
8h
Xcode won't symbolicate .ips crash log
I was my understanding that you're supposed to be able to open a .ips crash log in Xcode and see pretty much what you would see if the app had been running in the debugger when it crashed. But the addresses in my app don't get symbolicated. I opened the .ips in the same project and same version of Xcode that was used to create the app. The .dSym file is around, and I can use it to symbolicate using the atos tool. What am I missing?
0
0
45
19h
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
29
2d
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
70
2d
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
47
2d
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
56
2d
Development Team not showing in Xcode.
Xcode is not recognizing that I am part of a team to be able to build the application. And I deleted my user's certificates and I can't generate a new user. Appers the message: "There is a problem with the request entity You already have a current Development certificate or a pending certificate request" But, the essential is appers the development team on the Xcode and this is not working... I have the dev role.
0
0
49
2d
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?
0
0
67
2d
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
67
2d
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
51
2d
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.
0
0
57
2d
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
0
93
3d
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
77
3d