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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

An unknown error occurred. username does not match previous request (-1)
Hey people, I'm using (or rather trying to use) Swift Packages for my project. This is not about the countless other bumps I found along the road. (Xcode/SPM is still very beta with Xcode 12.0.1 but I'll reserve complaining about for another day). But one I did not even something vaguely useful when googling it. So I started out using file paths for my dependencies, like: .package(name: "BlaBla", path: "/Users/me/GitDev/BlaBla") for some reason that does not work when you want to chain dependencies (Another bug to fix, Apple!). So I wanted to change to versions using a git repo. I gave my repo a tag and put in: .package(url: "ssh://me@server.local/usr/home/me/GitDev/BlaBla", from: "0.0.1"), On the command line SPM has no problem resolving this:  % swift package resolve Fetching ssh://me@… Cloning ssh://me@… Resolving ssh://me@… at 0.0.1 In Xcode though, I get the line from the title: An unknown error occurred. username does not match previous request (-1) (by the way I have copied this by hand as the message could not even be copy & pasted) Any ideas how to solve this? Or even debug this any further? best Roddi
7
0
5.5k
Oct ’20
silent push notifications on simulator
I'm working on an app that makes use of both regular (visible) push notifications and silent push notifications. Both types are working fine on a device, but only the regular type is working in the simulator. I'm sending the same test payloads to both the device and simulator. To be more specific, I use this payload for a silent push notification: { 	"aps": { 		"content-available": 1 	}, 	"Simulator Target Bundle": "com.mycompany.MyApp" } And I try to send this payload to the simulator with this command: xcrun simctl push booted com.mycompany.MyApp silent.apns As far as I can see, the app in the simulator does not respond to this silent push notification, but the app on a device does when running both in the foreground and background. Is this a known issue? If so, has anybody been able to get this to work? Or are silent push notifications just not supported on the simulator (yet)?
3
3
3.3k
Oct ’20
"Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed"
I recently got a new MacBook and I'm trying to get my projects up and running on it. When I run on an iOS 14.2 device, it works fine. But whenever I try 13.7 or lower it won't let me run and this error pops up Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed I would like this to work so I can test on older devices on this laptop. Note: I got the new M1 chip MacBook so if that could be an issue please do let me know.
17
2
13k
Nov ’20
iOS simulator scrolling on Apple Silicon
Hi I have an larger app with scrollable elements (table views, textviews, collection views, map .. ). I purchased a Mac mini with M1 processor, and with the latest Xcode, I can't swipe with the simulator. It lags, so I can drag with the Magic Mouse, but the swipe gesture is not recognised properly. For the system apps (settings for example) it works. For any simple app, it does not. Has anyone faced this issue?
20
9
19k
Dec ’20
xcrun: error: invalid active developer path
I have this problem: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun "make all" terminated with exit code 1. Build might be incomplete. Could someone help me? Two days ago I installed the last software update to MacOS: 12.2.1 but I haven't installed the command line for Xcode cause I'm not using Xcode for programming. Could this be the problem? Thanks for the support.
11
4
29k
Feb ’21
Unable to launch app on iPhone from Xcode
Hi, I'm trying to test my app on my iPhone 12 Pro, but it's simply not launching and I'm not getting any valuable error information back. When Xcode is finished compiling and attempts to launch the app, I get "Unable to launch [App Bundle ID]". Clicking more details gives me: Details Unable to launch [App Bundle ID] Domain: com.apple.platform.iphoneos Code: -12- Request to launch [App Bundle ID] failed. Domain: com.apple.dt.deviceprocesscontrolservice Code: 2 Failure Reason: The operation couldn’t be completed. The process failed to launch. : Failed to launch process with bundle identifier '[App Bundle ID]'.- The operation couldn’t be completed. The process failed to launch. Domain: FBProcessExit Code: 64 Failure Reason: The process failed to launch. User Info: { BSErrorCodeDescription = "launch-failed"; }- The operation couldn’t be completed. Launch failed. Domain: RBSRequestErrorDomain Code: 5 Failure Reason: Launch failed.- Launchd job spawn failed with error: 2 Domain: NSPOSIXErrorDomain Code: 2 Failure Reason: No such file or directory- System Information macOS Version 11.0.1 (Build 20B29) Xcode 12.4 (17801) (Build 12D4e) Timestamp: 2021-02-20T23:07:52Z I've never encountered anything like this before so I'm not sure what I can do? Additionally, the app fails to load when clicking on it from the iPhone after Xcode has uploaded the app to the phone. It brings up a black screen and immediately closes. The same problem occurs when trying an iPad too. Using Xcode's console connected to my iPhone, I see the following error when trying to manually launch the app: (not sure if this means anything) error 23:38:40.875438+0000 SpringBoard Snapshot generation request for bundleID: [App Bundle ID] rejected due to the app being denylisted.
3
0
3.8k
Feb ’21
Could not download IOS Simulator Xcode 12.4
Macbook Air M1, get the error in Xcode 12.4: Could not download and install IOS 12.0 Simulator. Failed to download package from ADC. There are no valid accounts registered with Xcode that have the ability to access this resource. Contact Apple Developer Program Support to resolve account access issues. I have never had this error on the previous Xcode and Macbook on intel chip. Please can you tell me how to solve it.
17
2
21k
Feb ’21
Is there a SetFile Date limitation workaround
When running the following AppleScript (other portions were removed for clarity)… set newDate to "1/1/1953 00:00 AM" do shell script "SetFile -d " & quoted form of newDate & " " & quoted form of filePath I can change  the created date to any year from 1970 to 2079 but attempting any year outside that range returns unpredictable results.  For instance, using 1/1/1953, the created date became February 6, 2096. But if I enter 1/1/2096 the created date becomes September 3, 2061. Any year between 1970 and 2079 yields the correct result. So, what’s the workaround? I need to be able set the year to any date from 1920 to the present and SetFile apparently can’t handle that range. 
4
0
1.3k
Mar ’21
macOS app icon not updating. Cached?
Hi, If I change the AppIcon in Xcode's Assets.xcassets, and rerun my app, the image used in the dock and app switcher does not update. If I "Clean Build Folder", and re-run, then it updates. This is annoying when I keep tweaking the colors in the icon and want to see how they look. A full rebuild takes a while, because I have a few Swift Package dependencies. Anyone know a trick to get the AppIcon to stop caching (or whatever it's doing)? I tried killall Dock and killall Finder, but that didn't help. (macOS 11.2.3) Rob
4
0
3.3k
Mar ’21
CoreML fails to decrypt a model
We've 10 CoreML models in our app, each encrypted with a separate key generated in XCode. After opening and closing the app 6-7 times, the app crashes at model initialization with error: 2021-04-21 13:52:47.711729+0300 MyApp[95443:7341643] Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.apple.CoreML Code=9 "Failed to generate key request for 08494FB2-B070-440F-A8A5-CBD0823A258E with error: -42905" UserInfo={NSLocalizedDescription=Failed to generate key request for 08494FB2-B070-440F-A8A5-CBD0823A258E with error: -42905}: file MyApp/Model.swift, line 43 Looks like iPhone is blocking the app for suspicious behavior and the app fails to decrypt the model. We noticed that after ~10 hours the app is unlocked, it successfully decrypts and initializes the model. Opening and closing the app many times in a short period of time is indeed unnatural, but the most important question is how to avoid blocking? Would Apple block the app if a user opens and closes it 10 times during a day? How does the number of models in the app affect probability that the app will be blocked? Thanks!
7
0
2.9k
Apr ’21
How to conditionally link an xcframework?
Hi all, I have an xcframework for iOS that only contains an arm64 framework, not a simulator framework. When run on the simulator, no code from the framework is needed (it is stubbed/mocked out). However, I'm struggling to find how to link the xcframework only for device builds. So the situation is this: If I link the framework, device builds compile and run fine. For simulator, it fails with this error: error: While building for iOS Simulator, no library for this platform was found If I don't link the framework, simulator builds and runs fine, but on devices I get a dyld error at runtime. These results are understandable, but I'd like to know if it's possible to include the xcframework only for device builds, as this would seem to solve my problems... Any help would be appreciated.
2
0
1.2k
Jun ’21