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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Multiplatform project error on Xcode 14 beta: Your target is built for macOS but contains embedded content built for the iOS platform
When creating a new Multiplatform project on Xcode 14 beta and adding a Notification Service Extension Target, compilation fails with: error build: Your target is built for macOS but contains embedded content built for the iOS platform (Notification.appex), which is not allowed. This really limits the usefulness of the new multiplatform single target, especially if we cannot incorporate basic extensions. Is there any way to use single target multiplatform and still have the freedom to add necessary extensions to the app?
3
1
3.0k
Jun ’22
Xcode "Issue Navigator" shows stale errors and warnings
For as long as I've used Xcode, the Issue navigator shows stale errors and warnings even after the build is completely building and executing. It would be nice to have a way to retain file warnings without having to set "warnings as errors", but here the problems have already been fixed. Also need a "Reveal in Report Navigator" since half the time these errors/warnings lack 90% of the info needed to actually fix them. There's already a "Reveal in Project Navigator" that is almost never needed.
4
2
2.1k
Jun ’22
mocOS crashes and reboots while using Simulator
Every time I work with Xcode Simulator or SwiftUI's Xcode Previews my Mac freezes and reboots. I get below report after restart: panic(cpu 1 caller 0xffffff7fae0e7505): "Submission on work queue 33 failed due to insufficient space!\n" @IGGuC.cpp:2899 Panicked task 0xffffff95219449c0: 4 threads: pid 1358: SimMetalHost Backtrace (CPU 1), panicked thread: 0xffffff9520c88540, Frame : Return Address 0xffffffe5a9882de0 : 0xffffff8015a81c8d 0xffffffe5a9882e30 : 0xffffff8015be1596 0xffffffe5a9882e70 : 0xffffff8015bd0963 0xffffffe5a9882ec0 : 0xffffff8015a21a70 0xffffffe5a9882ee0 : 0xffffff8015a8205d 0xffffffe5a9883000 : 0xffffff8015a81816 0xffffffe5a9883060 : 0xffffff8016315163 0xffffffe5a9883150 : 0xffffff7fae0e7505 0xffffffe5a9883160 : 0xffffff7fae05ecf7 0xffffffe5a9883250 : 0xffffff7fae084844 0xffffffe5a9883280 : 0xffffff7fae08f6e5 0xffffffe5a98832f0 : 0xffffff7fae9d75b7 0xffffffe5a9883330 : 0xffffff7fae06c73d 0xffffffe5a9883350 : 0xffffff7fae06cb5d 0xffffffe5a98833c0 : 0xffffff7fae09b89e 0xffffffe5a98835e0 : 0xffffff7fae070ed4 0xffffffe5a9883620 : 0xffffff7fae9ed118 0xffffffe5a9883650 : 0xffffff7fae070b00 0xffffffe5a9883690 : 0xffffff7fae9ed2a7 0xffffffe5a98836d0 : 0xffffff7fae9ed996 0xffffffe5a9883970 : 0xffffff7fae0714f4 0xffffffe5a98839a0 : 0xffffff7fae9ee8f1 0xffffffe5a9883a30 : 0xffffff7fae9ec94b 0xffffffe5a9883a90 : 0xffffff7fae9ec741 0xffffffe5a9883ae0 : 0xffffff7fae9eb81d 0xffffffe5a9883b20 : 0xffffff7fae071137 0xffffffe5a9883b60 : 0xffffff8016283a8c 0xffffffe5a9883cc0 : 0xffffff8015b872e6 0xffffffe5a9883dd0 : 0xffffff8015a5c9ab 0xffffffe5a9883e60 : 0xffffff8015a731f9 0xffffffe5a9883ef0 : 0xffffff8015bb35aa 0xffffffe5a9883fa0 : 0xffffff8015a22256 Kernel Extensions in backtrace: com.apple.iokit.IOAcceleratorFamily2(462.8)[F0D1B5AF-356A-3F86-8829-8F00218602CB]@0xffffff7fae9a6000->0xffffff7faea10fff dependency: com.apple.driver.AppleMobileFileIntegrity(1.0.5)[2B96E04B-E2A5-3296-AF14-6A766880A652]@0xffffff80171a1000->0xffffff80171c2fff dependency: com.apple.iokit.IOGraphicsFamily(597)[BBEE13AB-2291-37D9-AAE4-9E565E8950A5]@0xffffff7faeb3f000->0xffffff7faeb6dfff dependency: com.apple.iokit.IOPCIFamily(2.9)[654ABF9D-EB24-3B64-AB1C-EC2AC8357192]@0xffffff8018624000->0xffffff801864ffff dependency: com.apple.iokit.IOReportFamily(47)[5578189C-7C1D-3158-B357-F8D6A216DCE1]@0xffffff8018661000->0xffffff8018663fff dependency: com.apple.iokit.IOSurface(302.14)[F0BF8EFA-AA35-37B5-B3AB-A8BCF5E62024]@0xffffff8018794000->0xffffff80187b0fff com.apple.driver.AppleIntelKBLGraphics(18.0.7)[1A72DE92-F799-3EFF-8AD4-B662C53C36AD]@0xffffff7fae059000->0xffffff7fae117fff dependency: com.apple.iokit.IOAcceleratorFamily2(462.8)[F0D1B5AF-356A-3F86-8829-8F00218602CB]@0xffffff7fae9a6000->0xffffff7faea10fff dependency: com.apple.iokit.IOGraphicsFamily(597)[BBEE13AB-2291-37D9-AAE4-9E565E8950A5]@0xffffff7faeb3f000->0xffffff7faeb6dfff dependency: com.apple.iokit.IOPCIFamily(2.9)[654ABF9D-EB24-3B64-AB1C-EC2AC8357192]@0xffffff8018624000->0xffffff801864ffff dependency: com.apple.iokit.IOSurface(302.14)[F0BF8EFA-AA35-37B5-B3AB-A8BCF5E62024]@0xffffff8018794000->0xffffff80187b0fff Process name corresponding to current thread (0xffffff9520c88540): SimMetalHost (iPhone 12: default Boot args: chunklist-security-epoch=0 -chunklist-no-rev2-dev chunklist-security-epoch=0 -chunklist-no-rev2-dev Mac OS version: 21F79 Kernel version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 Kernel UUID: 3C587984-4004-3C76-8ADF-997822977184 KernelCache slide: 0x0000000015800000 KernelCache base: 0xffffff8015a00000 Kernel slide: 0x0000000015810000 Kernel text base: 0xffffff8015a10000 __HIB text base: 0xffffff8015900000 System model name: Macmini8,1 (Mac-7BA5B2DFE22DDD8C) System shutdown begun: NO Hibernation exit count: 0 System uptime in nanoseconds: 2335401059040 Last Sleep: absolute base_tsc base_nano Uptime : 0x0000021fc0c0295e Sleep : 0x000000c429fd13d9 0x00000000bae420b6 0x000000a6581a552b Wake : 0x000000c435bb1b42 0x00000000bae11627 0x000000c4332c18c2 Compressor Info: 24% of compressed pages limit (OK) and 12% of segments limit (OK) with 5 swapfiles and OK swap space Zone info: Zone map: 0xffffff805595c000 - 0xffffffa05595c000 . PGZ : 0xffffff805595c000 - 0xffffff805695d000 . VM : 0xffffff805695d000 - 0xffffff85233c3000 . RO : 0xffffff85233c3000 - 0xffffff86bcc8f000 . GEN0 : 0xffffff86bcc8f000 - 0xffffff8b896f5000 . GEN1 : 0xffffff8b896f5000 - 0xffffff905615b000 . GEN2 : 0xffffff905615b000 - 0xffffff9522bc1000 . GEN3 : 0xffffff9522bc1000 - 0xffffff99ef628000 . DATA : 0xffffff99ef628000 - 0xffffffa05595c000 Metadata: 0xffffffa079aee000 - 0xffffffa099aee000 Bitmaps : 0xffffffa099aee000 - 0xffffffa09caee000 last started kext at 1655076280961: >usb.cdc.acm 5.0.0 (addr 0xffffff7fae81d000, size 12288) last stopped kext at 1766102575761: >usb.serial 6.0.0 (addr 0xffffff7fae893000, size 20480) loaded kexts: AGPM 129 !APlatformEnabler 2.7.0d0 X86PlatformShim 1.0.0 @filesystems.autofs 3.0 !AGFXHDA 140.3 !AUpstreamUserClient 3.6.9 !AMCCSControl 1.16 !ABridgeAudio!C 240.6 !AGraphicsDevicePolicy 6.5.7 BridgeAudioCommunication 240.6 !AAVEBridge 6.1 !A!IKBLGraphics 18.0.7 @AGDCPluginDisplayMetrics 6.5.7 pmtelemetry 1 !A!ICFLGraphicsFramebuffer 18.0.7 |IOUserEthernet 1.0.1 usb.!UUserHCI 1 !A!IPCHPMC 2.0.1 !AHV 1 !ADiskImages2 126.100.13 !A!ISlowAdaptiveClocking 4.0.0 !AThunderboltIP 4.0.3 BCMWLANFirmware4387.Hashstore 1 BCMWLANFirmware4378.Hashstore 1 BCMWLANFirmware4377.Hashstore 1 BCMWLANFirmware4364.Hashstore 1 BCMWLANFirmware4355.Hashstore 1 !AFileSystemDriver 3.0.1 @filesystems.tmpfs 1 @filesystems.lifs 1 @filesystems.hfs.kext 583.100.10 @BootCache 40 @!AFSCompression.!AFSCompressionTypeZlib 1.0.0 @!AFSCompression.!AFSCompressionTypeDataless 1.0.0d1 @filesystems.apfs 1934.121.2 !ABCMWLANBusInterfacePCIeMac 1 !ASDXC 3.2.1 |!ABCM5701Ethernet 11.0.0 @private.KextAudit 1.0 !AACPIButtons 6.1 !ASMBIOS 2.1 !AACPIEC 6.1 !AAPIC 1.7 @!ASystemPolicy 2.0.0 @nke.applicationfirewall 402 |IOKitRegistryCompatibility 1 |EndpointSecurity 1 @Dont_Steal_Mac_OS_X 7.0.0 @kec.!AEncryptedArchive 1 !UMergeNub 900.4.2 IO!BHIDDriver 9.0.0 driverkit.serial 6.0.0 @kext.triggers 1.0 !ASMBus!C 1.0.18d1 !AAudioClockLibs 140.1 !A!ILpssUARTv1 3.0.60 !A!ILpssUARTCommon 3.0.60 !AOnboardSerial 1.0 usb.IOUSBHostHIDDevice 1.2 |IOAudio!F 340.2 @vecLib.kext 1.2.0 !AGraphicsControl 6.5.7 |IONDRVSupport 597 X86PlatformPlugin 1.0.0 .............. Below is my system configuration: Model Name: Mac mini Model Identifier: Macmini8,1 Processor Name: 6-Core Intel Core i5 Processor Speed: 3 GHz Number of Processors: 1 Total Number of Cores: 6 Memory: 8 GB System Version: macOS 12.4 (21F79) Any help would be appreciated, thanks!
7
0
2.6k
Jun ’22
Is it possible to save a screenshot of a preview in Xcode 14?
The the enhancements to Xcode Previews in Xcode 14 are very helpful. I just had a situation where I wanted to take a screen capture of a preview of a view. Is there a built-in way to do that from Xcode, similar to taking a screen capture of the simulator screen? I realize I can just use a system-level screen capture, but then I have to adjust the size of what I capture to the area of the view in the preview. It would be great to just be able to have a button or shortcut and have the correct area captured.
3
2
2.5k
Jun ’22
App crashes when trying to run widget extension - M1 Mac with Rosetta
I have a Xcode project with a widget extension, Xcode, simulator and terminal are running with Rosetta (I can't change this). When I build and run the main project, the widget does not get loaded on the widgets list, when running the widget scheme on Xcode the app crashes when loading the application on simulator. Same happens on device. Macs with Intel silicon run it okay. Xcode without rosetta is also okay. Xcode log window shows the following message: SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'Gabriel.Widget-Rosetta.Widget' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)}." UserInfo={NSLocalizedDescription=Failed to show Widget 'Gabriel.Widget-Rosetta.Widget' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)}., NSUnderlyingError=0x600001106010 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)}}} Domain: DTXMessage Code: 1 User Info: {     DVTErrorCreationDateKey = "2022-07-06 14:45:31 +0000"; } -- System Information macOS Version 12.2.1 (Build 21D62) Xcode 13.2.1 (19586) (Build 13C100) Timestamp: 2022-07-06T15:45:31+01:00 Console shows the following message: libc++abi: terminating with uncaught exception of type NSException dyld4 config: DYLD_FRAMEWORK_PATH=/Users/gabriel.soria/DD/Widget-Rosetta-bhlamdqmnxdfvtapitjtbxxspnfc/Build/Products/Debug-iphonesimulator DYLD_LIBRARY_PATH=/Users/gabriel.soria/DD/Widget-Rosetta-bhlamdqmnxdfvtapitjtbxxspnfc/Build/Products/Debug-iphonesimulator DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_NSXPCDistantObject ___nsx_pingHost:]: unrecognized selector sent to instance 0x600003948aa0' _LSContextInitReturningError() failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf6701f12 bb1a56bb bba5f39f 3f7801a6 ... f9fe6ee0 ef307d24 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x9da4b2b1 56f7ac19 1a99bc21 b7ec95c2 ... c4004d14 03ef83dc }} terminating with uncaught exception of type NSException CoreSimulator 783.5 - Device: iPhone SE (2nd generation) (E360DB1E-33FF-45A4-926C-A6093DFB3699) - Runtime: iOS 15.2 (19C51) - DeviceType: iPhone SE (2nd generation)
1
0
1.2k
Jul ’22
accept incoming network connections in simulator - xcode 13.4.1
Does anyone know how to rid of this message? It is happening every time I build a project using the simulator with the following versions: xCode 13.4.1 mac Monterey 12.4. I didn't see this behavior in Xcode's previous versions. The issue seems to be because it is adding a new application every time I build the project into the firewall app list. (image below) Any tips on how to fix this?
5
4
1.9k
Jul ’22
CoreData causing error running Mac App - Is there a way to reset app so it starts fresh?
Yesterday I had issues with my CoreData database for my Multiplatform app which resulted in changes to the schema. I reset the CloudKit version and, on the iOS simulator, had to delete my app and run the code again to get it to work. My issue is with the macOS target. I'm getting the same fatalError (Fatal error: Unresolved error Error Domain=NSCocoaErrorDomain Code=134140 "Persistent store migration failed, missing mapping model.") when running the macOS app but I can't figure out how to delete it so I can run it fresh like I did with the iOS version. I've found where the application is created (in the Debug directory ultimately within my app's Build directory) and removed them all but when run the newly created application has the same error. Should I move up the directory structure and remove the entire app directory within Xcode/DerivedData or is there another way? Wanted an answer before I do something I can't go back from :) Thanks, Kyra
2
1
1.8k
Jul ’22
Xcode crash on startup
Hey Community, I got a bit of a problem here. My Xcode (13.4.1) decided to not launch any project as of yesterday anymore. I have had this problem before and reinstalled macOS to resolve it. But I don't want to reinstall macOS every three months. I noticed that playgrounds launch with no effort, but all Xcode projects create a beachball loading and then Xcode stops responding. This also happens when creating a new Xcode project. I tried removing Derived Data, the entire Developer folder, launching in Rosetta, reinstall Xcode, install the Xcode 14 Beta to see if that helps but to no avail. I also tried downloading a clean Xcode from the Developer website. I don't think it's memory related or anything, I have a 16-inch MacBook Pro with M1 Max, 32 Gb Ram, 512 Gb storage that is only halfway full. See logs here. Wasn't able to add it as attachment so it's a shared iCloud document.
2
0
627
Jul ’22
Certain pods are not working in MacBook M1 chip and prompting error
Dear Apple Developers, I'd like to bring it to your kind notice that, when I try to incorporate certain pods namely - pod 'CountryPickerView' pod 'CryptoSwift' pod 'ACPGriffon' pod 'ACPAnalytics' pod 'ACPMobileServices' pod 'Charts' pod 'GooglePlaces' its evoking an error. Error message -  directory not found for option '-F/Users/a1606085/Library/Developer/Xcode/DerivedData/Test123-dogpfwtyviqwuiajsfvyexviimuf/Build/Products/Debug-iphonesimulator/CountryPickerView' ld: framework not found CountryPickerView. Whereas the below pods are working absolutely fine: pod 'Alamofire' pod 'JSONUtilities' pod 'JJFloatingActionButton' pod 'CropViewController' pod 'ACPUserProfile', '> 2.0' pod 'ACPCore', '> 2.0' pod 'ReachabilitySwift' pod 'SwiftyGif' Here are few things I tried but all of them failed to help: Updated CocoaPods using following command in terminal 'sudo gem install cocoapods' . Then did pod install again Adding arm64 in excluded architecture Uninstalling Xcode application and reinstalled version of Xcode 13.4.1 Clearing data from derived data folder and re building I'm currently using a MacBook Pro M1 chip. Is this an issue with Mac M1 ? Because these pods are working fine in other MacBooks other than M1. Are there any suggestions that can help resolve this problem and make the code work? (Tried attaching screenshots but unable to) Kindly help with this issue ASAP since I've got a project deliverable in pipeline. Thanks in advance
1
0
920
Aug ’22
Fatal Error in ModelData at line 43
Failed to decode landmarksData.json from bundle because it appears to be invalid JSON. Full disclosure - Im extremely new to this and am playing around with the swift tutorials to see what it can do and see if I could build an app. Any advice is appreciated. I added a few locations to the SwiftUI Tutorial for Lanmarks and this is what happened. I have checked that JSON file and all commas are in the correct place everything is correct but im getting this error. Not sure what im doing incorrectly. Can anyone give me assistance on how to fix this. I can only preview favorite button, circle image and map. Everything else appears as Fatal Error in ModelData.
4
0
2.6k
Aug ’22
Finding source of crash
I've been debugging the source of a crash bug (right on app launch!) and it reminded me that some of my old code is sort of a mess. Do you have luck with static analyzer or other Xcode tools? For starters maybe I'll try to scan some Apple sample code to see how well it does, haha.
5
0
1.4k
Aug ’22
Xcode freezes/ hangs on startup and does not load any application
I recently updated my M1 mac to Monterey 12.5.1 and since my xcode fail to load my project. Xcode opens and hangs as seen in the picture. I have to force quit to close. The installed version of xcode is Version 13.4.1 Things I have tired: Completely removing and reinstalling xcode from the dev site Restarting device Suggestion from here https://stackoverflow.com/questions/11247008/xcode-freezes-on-startup-while-loading-project Even if I fully create a new project from the start screen, it still freezes on load Nothing seems to be working. Wondering if anyone can help Thanks
6
1
3.2k
Aug ’22
PassbookUIService crash on Xcode 14 beta 6 causes StoreKit failure
I am running a very simple UI test on Xcode 14 beta 6 that sets up a StoreKit testing session and then attempts to bring up a purchase dialog. Unfortunately, PassbookUIService is crashing and thereby causing the purchase to be canceled. Here is the crash report: PassbookUIService-2022-08-30-094331.ips.txt For context, the UI test is very simple: func testExample() throws { _ = self.expectation(description: "Never fulfilled") let session = try SKTestSession(configurationFileNamed: "CatsAndLlamas.storekit") session.clearTransactions() session.resetToDefaultState() session.disableDialogs = false let app = XCUIApplication() app.launch() let tablesQuery = app.tables tablesQuery.staticTexts["Buy Product"].tap() tablesQuery.cells.containing(.staticText, identifier:"Silver Llama").staticTexts["Subscribe"].tap() waitForExpectations(timeout: 30) } On an iOS 15.5 simulator device, the UI test works as expected. However, on an iOS 16 simulator device, the UI test behaves as if the purchase request were canceled before the dialog is even displayed. This is when PassbookUIService crashes. I believe this crash is causing StoreKit (or StoreKitTest) to consider the purchase canceled. (I have screenshots of the behavior but I’ve not been able to successfully include them in this post for some reason.)
9
5
1.9k
Aug ’22
malloc_history never works for me: unable to read input graph: The data couldn’t be read because it isn’t in the correct format
root# malloc_history /tmp/stack-logs.60147.10f5f7000.agent-tests.0EDkOu.index -callTree malloc_history[60193]: [fatal] unable to read input graph: The data couldn’t be read because it isn’t in the correct format. I ran my program as root# env MallocDebugReport=stderr MallocGuardEdges=1 MallocStackLogging=1 MallocStackLoggingNoCompact=1 MallocScribble=1 MallocErrorAbort=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib ./test/agent-test (The program then segfaults, which looks to be due to a memory stomper.)
1
0
684
Aug ’22