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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Xcode unable to create open panel
I cannot create any new projects in XCode (reliably). I can MABE do it when restarting my M2 Macbook Air (macOS Sequoia) or when I plug in a monitor. Steps to create it: After restarting the mac, create a "macOS, command line tool, C++" project in Xcode (assuming the I can create it), quit Xcode. Create another project of the same type in Xcode (again), Xcode will freeze for a few minutes with the beach ball. After that, there is a window popup with the title: “Unable to create an open panel”, its content: “Try your operation again. If that fails, quit and relaunch the application and try again.” This bug makes Xcode unable to create a new project, or create a new C++ file in an existing project.
0
1
339
Oct ’24
Run test specific setup logic on different target
Our use case is that we need to run a CLI script (on Mac) to set up backend configuration before each test case (UI test on real iOS device). The setup logic is test specific, so using pre-build scripts is not an option. Is this support in any way or what are best practices around such a setup? Ideally, we would still be able to execute the tests from within Xcode.
0
0
341
Nov ’24
Should I worry about this error message?
I have a SwiftData Model which includes a property of type Array. @Model final class Handler { public var id: UUID public var name: String public var mailingAddress: [String] . . . public init() { self.id = UUID() self.name = "" self.mailingAddress = [] . . . } When I use this Model in code, the mailingAddress field appears to work just as I would expect, but when saving it (running in Simulator), I see the following logged message: CoreData: fault: Could not materialize Objective-C class named "Array" from declared attribute value type "Array<String>" of attribute named mailingAddress Should I be worried about this?
0
1
462
Oct ’24
__isPlatformVersionAtLeast SIGABRT (ABORT)
I am working on a cross-platform application, and we recently released updates for our apps. We received a large number of crashes in our Crashlytics logs. All the crashes seem to occur in the APM submodule classes with "__isPlatformVersionAtLeast SIGABRT (ABORT)." While checking the Crashlytics event summary details, I found that the crashes happen during the execution of the didFinishLaunchingWithOptions function in the AppDelegate. didFinishLaunchingWithOptions: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Firebase [FIRPerformance sharedInstance].instrumentationEnabled = 0; [FIRApp configure]; NSDictionary *props = @{ @"TESTING": @"iOS", @"Date": [NSDate date] }; //Clevertap [[CleverTap sharedInstance] setInAppNotificationDelegate:self]; [[CleverTap sharedInstance] setPushNotificationDelegate:self]; NSString *appPath = [[NSBundle mainBundle] bundlePath]; NSLog(@"appPath ------ %@",appPath); // Config an additional instance NSLog(@"multiple instance registration"); CleverTapInstanceConfig *ctConfig = [[CleverTapInstanceConfig alloc] initWithAccountId:@"TEST*******" accountToken:@"TEST*****"]; NSLog(@"multiple instance registration %@",ctConfig); CleverTap *additionalCleverTapInstance = [CleverTap instanceWithConfig:ctConfig]; [AEPMobileCore setLogLevel:AEPLogLevelDebug]; [AEPMobileCore configureWithAppId:@"99********"]; return YES; } Podfile: pod 'Firebase/Analytics' pod 'Firebase/Auth' pod 'Firebase/Crashlytics', '10.28.1' pod 'FirebasePerformance', '10.28.0' pod 'FirebaseRemoteConfig' pod 'CleverTap-iOS-SDK', '6.2.1' Stack Trace: Crashed: APMIdentityWorkerQueue 0 libsystem_kernel.dylib 0xc274 __pthread_kill + 8 1 libsystem_pthread.dylib 0x7ef8 pthread_kill + 268 2 libsystem_c.dylib 0x77ad8 abort + 128 3 libsystem_malloc.dylib 0x9c38 malloc_vreport + 896 4 libsystem_malloc.dylib 0x98a8 malloc_report + 64 5 libsystem_malloc.dylib 0x8e80 find_zone_and_free + 528 6 App 0xfe574 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 7 App 0xf7e04 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 8 App 0xfc250 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 9 App 0xfbbec (Missing UUID 0faca6be3dbe3121a960c0897cece480) 10 App 0x2b4d00 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 11 App 0x2bed74 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 12 App 0x18344c (Missing UUID 0faca6be3dbe3121a960c0897cece480) 13 libsystem_pthread.dylib 0x7ef8 pthread_kill + 268 14 App 0x28354fc __isPlatformVersionAtLeast + 4384462076 15 ??? 0x3015b5920 (Missing) 16 ??? 0xd5e00078c (Missing) 17 ??? 0x1f058ed (Missing) APMExperimentWorkerQueue 0 libsqlite3.dylib 0x815f0 sqlite3_table_column_metadata + 2400 1 libsqlite3.dylib 0x13b2c sqlite3_exec + 46032 2 libsqlite3.dylib 0xaae0 sqlite3_exec + 9092 3 libsqlite3.dylib 0x9ac8 sqlite3_exec + 4972 4 libsqlite3.dylib 0x9158 sqlite3_exec + 2556 5 libsqlite3.dylib 0x12830 sqlite3_exec + 41172 6 libsqlite3.dylib 0x11f20 sqlite3_exec + 38852 7 libsqlite3.dylib 0x11e64 sqlite3_exec + 38664 8 libsqlite3.dylib 0xb14bc sqlite3_sourceid + 132108 9 libsqlite3.dylib 0xd130 sqlite3_exec + 18900 10 libsqlite3.dylib 0xc224 sqlite3_exec + 15048 11 libsqlite3.dylib 0x9ac8 sqlite3_exec + 4972 12 libsqlite3.dylib 0x9158 sqlite3_exec + 2556 13 libsqlite3.dylib 0x8d30 sqlite3_exec + 1492 14 App 0x58249c -[APMSqliteStore prepareSQL:error:] + 4339819676 15 App 0x58295c -[APMSqliteStore validateDatabaseWithError:] + 4339820892 16 App 0x58289c -[APMSqliteStore openAndValidateDatabase:] + 4339820700 17 App 0x57ecbc -[APMSqliteStore initWithDatabasePath:error:] + 4339805372 18 App 0x505ae4 -[APMEDatabase initializeDatabaseResourcesWithContext:databasePath:] + 4339309284 19 App 0x505a0c -[APMEDatabase initWithPath:] + 4339309068 20 App 0x50d294 -[APMETaskManager startTaskManagerOnWorkerQueue] + 4339339924 21 App 0x50d24c __35-[APMETaskManager startTaskManager]_block_invoke + 4339339852 22 App 0x50e578 __46-[APMETaskManager dispatchAsyncOnWorkerQueue:]_block_invoke + 4339344760 23 libdispatch.dylib 0x213c _dispatch_call_block_and_release + 32 24 libdispatch.dylib 0x3dd4 _dispatch_client_callout + 20 25 libdispatch.dylib 0xb400 _dispatch_lane_serial_drain + 748 26 libdispatch.dylib 0xbf30 _dispatch_lane_invoke + 380 27 libdispatch.dylib 0x16cb4 _dispatch_root_queue_drain_deferred_wlh + 288 28 libdispatch.dylib 0x16528 _dispatch_workloop_worker_thread + 404 29 libsystem_pthread.dylib 0x4934 _pthread_wqthread + 288 30 libsystem_pthread.dylib 0x10cc start_wqthread + 8 Deployment version: 12.2 Could anyone know the above issue?
0
1
332
Oct ’24
iOS 18 Simulator and CloudKit
I am running Xcode Version 16.0 (16A242d) and in the process of testing an app I developed that uses CoreData and CloudKit. When running my app in an iPhone 16 Pro simulator using iOS 18, it does not sync with cloudKit. If I run it in an iPhone 15 Pro simulator using iOS 17.5 it syncs fine with CloudKit. Has anyone else encountered this issue, or have I done something wrong in my setup. Thanks for any help Mike
0
0
277
Oct ’24
Screen Capture ReplayKit: How do I know if user had consented for Screen Capture alert?
I understand that there are no delegate methods for this. But to determine a positive consent from user to Record Screen needs to be evaluated via block parameter. When user denies the permission by mistake, and, if user tries again, the alert is not showing up. How do I reset the permission and throw the below alert again?
0
0
462
Oct ’24
KeyedUnarchive a previously object archived with NSArchiver archivedDataWithRootObject
Hi, in my previous macOS app I used to archive a dictionary to a preference file using [NSArchiver archivedDataWithRootObject:dictionary]; and to unarchive it using [NSUnarchiver unarchiveObjectWithData:dataFromDisk]; Now I would like to replace the 2 deprecated methods with NSError *error; NSSet *classSet = [NSSet setWithObjects:[NSDictionary class], [NSArray class], [NSString class], [NSNumber class], [NSData class], nil]; NSDictionary *dictionary = [NSKeyedUnarchiver unarchivedObjectOfClasses:classSet fromData:dataFromDisk error:&error]; But I get a nil dictionary and the error 4864: non-keyed archive cannot be decoded by NSKeyedUnarchiver. So I guess I should first keep on unarchiving the preferences dataFromDisk using the old deprecated method [NSUnarchiver unarchiveObjectWithData:dataFromDisk]; Then I could use the new NSKeyedArchiver and NSKeyedUnarchiver methods for the upcoming release. But, if this deprecated method [NSUnarchiver unarchiveObjectWithData:dataFromDisk]; fails to unarchive the old data (and on some machines now it fails), how could I use the new methods? Should I consider my old preference file gone? Is a way to force the new NSKeyedUnarchiver method to unarchive data previously archived with NSArchiver ?
0
0
152
Sep ’24
Sorting source code files in Xcode's navigator
Since Xcode 16 sorting source code files in the navigator with ascending order by name results in: A.hpp A.cpp B.hpp B.cpp ... Previous versions of Xcode sorted the files correctly (with respect to ascending order): A.cpp A.hpp B.cpp B.hpp Is this a bug or is there any parameter I have to set to get the old ordering back?
0
1
320
Oct ’24
XCode 16 - Wifi debugging failed
Hi Apple Developer and DTS team, I facing a big problem when develop the application that trying to connect to WAC firmware (iOT device). When I debugging the the application, the real device switch internet connection to WAC wifi, and my XCode will showing as failed. The problem here when I trying to back to old network and trying to build again. the XCode will stuck on building with multiple installing application. Actually I seen that the XCode do not cancel old installing build. That issue not appears on XCode 15.4 with same source code. I belive that issue come from the bad internet connection. And now XCode 16 disable to turn off WIFI build as: That why I can't select the build and debugging the app over cable anymore. My question is: How I can disable WIFI debugging? Because my wifi debug not stable when I developing the application over WAC device. How I can cancelling the installing actions of XCode to build new one? Best Regards, A ****** iOS Developer guy. [Personal Information Edited by Moderator]
0
1
529
Oct ’24
dyld[53510]: Symbol not found - React Native app issue with running on real device
I develop React Native app with dynamically linked pods, and app runs on simulator well, while running it on connected device returns this error: dyld[53510]: Symbol not found: __ZN5swift39swift51override_conformsToSwiftProtocolEPKNS_14TargetMetadataINS_9InProcessEEEPKNS_24TargetProtocolDescriptorIS1_EEN7__swift9__runtime4llvm9StringRefEPFPKNS_35TargetProtocolConformanceDescriptorIS1_EES4_S8_SC_E Referenced from: <4A3492BF-0479-3124-BE58-05BAED71BB20> /private/var/containers/Bundle/Application/0D9FDF5C-BBC9-4060-972B-B2D6FD91E321/BFF.app/Frameworks/Framework1 Expected in: <0549B906-CB15-3735-AA15-FAEB5F687C8B> /private/var/containers/Bundle/Application/0D9FDF5C-BBC9-4060-972B-B2D6FD91E321/BFF.app/Frameworks/Framework2 I already tried different things: Different versions of IPHONEOS_DEPLOYMENT_TARGET Ensured that all dependencies using same Swift version Different linking Tested on different devices and iOS versions Standard cleaning of derived data and reinstalling podfiles also included BUILD_LIBRARY_FOR_DISTRIBUTION="YES" ENABLE_BITCODE="NO"
0
0
460
Oct ’24
xCode升级到16.0后编译webrtc代码报错 _Float16 is not supported on this target
xCode升级到16.0后编译webrtc代码报错: [23/996] CXX clang_x64/obj/third_party/protobuf/protobuf_full/field_mask.pb.o FAILED: clang_x64/obj/third_party/protobuf/protobuf_full/field_mask.pb.o ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF clang_x64/obj/third_party/protobuf/protobuf_full/field_mask.pb.o.d -DHAVE_ZLIB -D_LIBCPP_HAS_NO_ALIGNED_ALLOCATION -DCR_XCODE_VERSION=1600 -DCR_CLANG_REVISION="n346557-4e0d9925-1" -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=375504 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -I../.. -Iclang_x64/gen -I../../third_party/protobuf/src -I../../third_party/zlib -fno-strict-aliasing -fstack-protector -fcolor-diagnostics -fmerge-all-constants -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -O2 -fno-omit-frame-pointer -gdwarf-4 -g2 -isysroot ../../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -mmacosx-version-min=10.10.0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wall -Wno-unused-variable -Wno-misleading-indentation -Wunguarded-availability -Wno-range-loop-analysis -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-pointer-to-int-cast -Wno-unused-function -Wno-shorten-64-to-32 -std=c++14 -stdlib=libc++ -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -c ../../third_party/protobuf/src/google/protobuf/field_mask.pb.cc -o clang_x64/obj/third_party/protobuf/protobuf_full/field_mask.pb.o In file included from ../../third_party/protobuf/src/google/protobuf/field_mask.pb.cc:4: In file included from ../../third_party/protobuf/src/google/protobuf/field_mask.pb.h:8: In file included from ../../buildtools/third_party/libc++/trunk/include/string:504: In file included from ../../buildtools/third_party/libc++/trunk/include/string_view:175: In file included from ../../buildtools/third_party/libc++/trunk/include/__string:56: In file included from ../../buildtools/third_party/libc++/trunk/include/algorithm:643: In file included from ../../buildtools/third_party/libc++/trunk/include/memory:653: In file included from ../../buildtools/third_party/libc++/trunk/include/typeinfo:60: In file included from ../../buildtools/third_party/libc++/trunk/include/exception:81: In file included from ../../buildtools/third_party/libc++/trunk/include/cstdlib:85: In file included from ../../buildtools/third_party/libc++/trunk/include/stdlib.h:100: In file included from ../../buildtools/third_party/libc++/trunk/include/math.h:303: ../../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/math.h:614:27: error: _Float16 is not supported on this target extern _Float16 __fabsf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0)); 这个怎么解决?
0
1
414
Oct ’24
Continuous Devicectl Errors: CoreDeviceError 3002, 12010, and 1000 with iOS 18.1/iPadOS18.0
Hello, I’ve been experiencing repeated errors when trying to install my app via flutter run --release on iOS devices using Xcode 16.1 (build 16B5014f) on macOS 15.1. When running the app in debug mode, it sometimes works but takes a long time to install. However, the installation in release mode fails consistently. This issue occurs on both my iPhone and iPad, both running iOS 18.1 and iPadOS 18, respectively. The errors keep rotating between three variations: Error 1: CoreDeviceError 3002 Error executing devicectl: ProcessException: Process exited abnormally with exit code 1: ERROR: Failed to install the app on the device. (com.apple.dt.CoreDeviceError error 3002 (0xBBA)) Connection with the remote side was unexpectedly closed : "XPCErrorDescription" => "Connection interrupted" Error 2: CoreDeviceError 12010 Error executing devicectl: ProcessException: Process exited abnormally with exit code 1: ERROR: The developer disk image could not be unmounted on this device. (com.apple.dt.CoreDeviceError error 12010 (0x2EEA)) Could not read from the device. (com.apple.dt.CoreDeviceError error -402653180 (0xE8000004)) Error 3: CoreDeviceError 1000 Error executing devicectl: ProcessException: Process exited abnormally with exit code 1: ERROR: The specified device was not found. (com.apple.dt.CoreDeviceError error 1000 (0x3E8)) What I've Tried So Far: Reinstalled Xcode, cleaned the build folder, and cleared DerivedData. Tried using both an iPhone and an iPad running iOS 18.1 and iPadOS 18.0. Ensured that Developer Mode is enabled on both devices. Disabled VPNs (Bitdefender) and firewall settings. Manually mounted the developer disk image via Xcode. Restarted the Mac, Xcode, and devices multiple times. Despite these steps, the errors persist, and I’m unable to install the app on either device. I would appreciate any guidance or suggestions on how to resolve this issue. System Information: macOS Version: 15.1 (Build 24B5055e) Xcode Version: 16.1 (Build 16B5014f) Devices: iPhone 14 running iOS 18.1, iPad running iPadOS 18.0 Thank you in advance!
0
1
1k
Sep ’24
Xcode: All Pull Request Changes + Code Review
I have the newest Xcode and macOS. When I'm trying to check Pull Request changes then when I click on any changed/added file, then instead of view with file I see infinite spinner. This happened in all files. I've tried to reinstall Xcode, macOS, clone new repo. This feature works once per 10-20 tries. Also when I try to manually compare uncommitted changes to some commit in Code Review mode, then I don't see any changes and no error appears. When I use git command line command in terminal, everything works and I receive changes. What can I do to fix this problem? I've tried Xcode 16.1 beta, and I can't go back to Xcode 15. Anyone has this problem? Anyone has any ideas?
0
1
365
Oct ’24
Help with SKTestSession Setup - ASDErrorDomain Code 505 Error
Hello everyone, I’m having trouble configuring SKTestSession for StoreKit testing in my UI tests. Specifically, I’m encountering the ASDErrorDomain Code 505 error when trying to set the storefront and locale in my test configuration. Despite following the setup steps, I keep getting errors indicating that the storefront and locale cannot be set, and the transactions are not being processed correctly. Here are the error messages I’m seeing: [SKTestSession] Error saving configuration file: Error Domain=ASDErrorDomain Code=505 "(null)" [SKTestSession] Error setting storefront to JPN for com.company.product: Error Domain=ASDErrorDomain Code=505 "(null)" [SKTestSession] Error fetching the current storefront: Error Domain=ASDErrorDomain Code=505 "(null)" [SKTestSession] Error setting value to ja for identifier 4 for com.company.product: Error Domain=ASDErrorDomain Code=505 "(null)" [SKTestSession] Error fetching value for identifier 4 for com.company.product: Error Domain=ASDErrorDomain Code=505 "(null)" These errors suggest that SKTestSession is unable to save or apply the configuration properly, but I’m not sure why. I’ve tried various storefronts and locales, but the issue persists. I’m running this on Xcode 16.0 (16A242d) on macOS 14.7 and 15. Below is the code for the setUpSession function I’m using to configure the session: func setUpSession(configuration: String = "Configuration", storefront: String? = nil, localeIdentifier: String? = nil) throws -> SKTestSession { var session: SKTestSession! try XCTContext.runActivity(named: "Set up subscriptions for \"\(configuration)\" storefront: \"\(storefront ?? "")\" and locale: \"\(localeIdentifier ?? "")\"") { activity in session = try SKTestSession(configurationFileNamed: configuration) if let storefront { session.storefront = storefront } if let localeIdentifier { session.locale = Locale(identifier: localeIdentifier) } session.disableDialogs = true let info = XCTAttachment(string: "storefront: \(session.storefront)\nlocale: \(session.locale.identifier)\ntransactions: \(session.allTransactions().count)") info.name = "Session configuration" activity.add(info) XCTAssertEqual(session.storefront, storefront, "Failed to set storefront") XCTAssertEqual(session.locale.identifier, localeIdentifier, "Failed to set locale") } return session } What I’ve Tried: Ensuring that storefront and locale values are valid. Resetting StoreKit configuration in Xcode’s scheme settings. Deleting derived data and restarting Xcode. Testing with different values for storefront and locale. Has anyone encountered similar issues with ASDErrorDomain Code 505, or can anyone point out what might be causing this? Any help would be greatly appreciated! Thank you!
0
3
830
Oct ’24
iOS 18 features not working in Xcode iOS playground
When I create a new iOS playground in Xcode 16.0 with an iOS 18.0 SDK installed, I cannot use some of the new features such as the new way for programming tab layouts. When I just use an Xcode project, these features work as expected. In a playground, I get errors saying "x is only available in iOS 18.0 and later". I have noticed this for more than just this feature. Is there some way I can force the playground to run with iOS 18 as I have the appropriate SDKs installed?
0
2
548
Oct ’24
Slow bundle copy build phase from dependency
We have a dependency, Apollo iOS, that is managed by SwiftPM in an internal module Swift Package. That internal Swift Package is then linked and included in our iOS target. The iOS target has an associated WidgetKit extension app. When archiving the app, we're seeing extremely long "Copy Apollo_Apollo.bundle" build steps, on the magnitude of 15 minutes. This is only happening when copying the bundle for the Widget extension app. Builds are done with Xcode 15.2, but we've tried on 15.4 and 16.2, seeing a few minutes shaved off. How can we begin to debug this issue?
0
0
233
Dec ’24
Simulator not working
Since its update to iOS 18.0, I have not been able to use the Simulator in Xcode at all. It is stuck loading for a very long time, and then it crashes. I managed to get it to start once, but it used up all of my system's memory immediately. I have not had any problems with the Simulator before the iOS 18.0 update. Additionally, after the Simulator crashing, the StoryBoard usually stops working as well, until I restart Xcode. (I use an M1 MacBook Air with 8GB of RAM)
0
0
538
Sep ’24