Xcode 13 - Cannot Submit Archive - Errors occurred while locating signing assets - xcode

This issue only started after updating to Xcode 13. Never had it under 12.x and no other changes. I am tying to send an Archive to Appstore Connect for a client. I have the "App Manager" role which has always been enough for this activity. However, when trying to send or even validate in Xcode, I receive an error related to "locating signing assets" with the log indicating the following:
2021-10-02 18:18:38 +0000 [MT] Failed to locate signing assets with
errors: (
"Error Domain=DeveloperAPIServiceErrorDomain Code=5 "Communication with Apple failed."
UserInfo={IDEDistributionIssueSeverity=3,
NSLocalizedRecoverySuggestion=You are not allowed to perform this
operation. Please check with one of your Team Admins, or, if you need
further assistance, please contact Apple Developer Program Support.
https://developer.apple.com/support,
NSLocalizedDescription=Communication with Apple failed.}",
"Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for 'com.company.app' were found"
UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=No
profiles for 'com.company.app' were found,
NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS App Store
provisioning profiles matching 'com.company.app'.}" )
I have tried to remove my account from Xcode and re-add, but to no effect. Again, I have had the App Manager role forever and never had a problem until upgrading to Xcode 13. I was thinking of having him elevate me to "Administrator" but that really should not be necessary. I also created a new distribution cert through Xcode (no errors there) but that didn't help either.
As an update. I went the manual route and created a profile and chose to select it manually rather than having Xcode handle it automatically. That worked. However, of course it should not have to work that way and I still don't understand why the automatic method is failing.
Anything else I can try?

It seems an Apple issue with the automatic sign-in process with Xcode 13. But maybe it's a wanted behavior for Xcode 13 using cloud base certs instead of the local ones.
Here's my story looking for a solutions for this.
I can confirm that downgrade back to Xcode 12 or switch to the manual signing way all works fine
Someone says that doing that:
Switch "automatically manage signing" in the project or re-select
Team. Make sure the changes appear in the project file:
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic;
May solve the issue, but it didn't work for me.
It seems that Xcode 13
In Xcode 13 or later, Xcode will cloud sign any apps or software for
distribution when you’re using the Xcode Organizer archive and
distribution workflow. Additional permissions are available in App
Store Connect to enable Admins and Developers to sign apps and
software with these certificates.
So I ended up enabling Access to Cloud Managed Distribution Certificate in App Store Connect -> Users and Access for my account, as Jane Doe said in this thread.
And that did solve the issue.
Here are all my references:
https://developer.apple.com/forums/thread/690763
https://developer.apple.com/forums/thread/688626
https://help.apple.com/developer-account/#/dev8e84490b9

Related

iOS 15 Untrusted Developer issue

I have updated recently to a new iOS 15 and after I built and run my application in Xcode, while have been logged in with a same developer account as before iOS 15 installation, I get this message:
The operation couldn’t be completed. Unable to launch com.xyz.xyz.xyz
because it has an invalid code signature, inadequate entitlements or
its profile has not been explicitly trusted by the user.
and the error log:
Could not launch “my-project0name” Domain: IDEDebugSessionErrorDomain
Code: 3 Failure Reason: The operation couldn’t be completed. Unable to
launch com.xyz.xyz.xyz because it has an invalid code signature,
inadequate entitlements or its profile has not been explicitly trusted
by the user. User Info: {
DVTRadarComponentKey = 855031;
IDERunOperationFailingWorker = DBGLLDBLauncher;
RawUnderlyingErrorMessage = "The operation couldn\U2019t be completed. Unable to launch com.xyz.xyz.xyz because it has an invalid
code signature, inadequate entitlements or its profile has not been
explicitly trusted by the user."; }
System Information
macOS Version 11.6 (Build 20G165) Xcode 13.0 (19234) (Build 13A233)
Timestamp: 2021-09-21T12:36:18+02:00
Earlier (on iOS14), this could be solved by going to:
Settings.app -> General -> Profile -> Select Profile -> Trust
But now (on iOS15) I can't actually find it at that location. How would I fix this?
From what i understand, this might be a bug connected to iOS 15 / xcode 13.
I found a solution which is to create a new Apple ID and use it to sign your app in xcode.
You can add a new team by going into "Signing & Capabilities"-tab and select "Add account" where you select a team.
Once you've done this and run the application on your device again, the option to trust the application in Settings > General > Device Management should appear!
As #ujell pointed out. The provisioning profile generated prior iOS 15 is preventing installation on the new release. Therefore, you will need to generate a new provisioning profile for your app. Try the following:
Quit Xcode
Go to the directory of cached provisioning profiles (cd
~/Library/MobileDevice/Provisioning Profiles/)
Back up the existing
files to another directory
Remove all profiles listed under
~/Library/MobileDevice/Provisioning Profiles/
Launch Xcode
Install/run the app on your device
Xcode will detect that there are no eligible profiles on your local system and request a new one during the next build to a device. The new profile will be compliance with iOS 15 provisioning.
NOTE: if it still doesn't work, then install the iOS 15.2 beta release (Build 19C5026i or later) on your device and try the steps above again.
Indeed, it looks like, the problem occurs only with IOS >hardware< real devices running >= iOS 15
I see no option in Settings allowing me to set the app dev as trusted.
This does NOT occur with my older (real) iPad Air, running with iOS 12.5. The app runs immediately without prompting for trust etc.
It also runs without problems on Xcode's simulator devices with iOS 15.
So yes, I think it is an iOS 15 and/or Xcode issue.
reported this to Apple.
Ios15 changes trusted application position to:
settings -> general -> vpn and device manage
then you can see your application under the Developer App, click it and verify it
iOS 13
in your iphone,got to
Settings -> General -> VPN and device management -> Developer app ->Trust and accept
At least my issue was the result of Apple again messing with the code signing creating a ling tail of side effects.
iOS15 code signs differentially on the "new" type of certificates.
I'm developing an app that is connection to a device via WIFI without internet connection.
The initial development was done on Xcode 13.1 and an iOS14 iPad. That worked well. As usual the iPad needed to be on a WIFI with internet connection at the first launch to verify the code signing. After that it was fine to launch the app from Xcode to the iPad while it being on the WIFI without internet connection. The app didn't need any additional code signing verification.
After updating the iPad to iOS15 every launch started to fail with the error unverified when the iPad was on WIFI without internet connection. Launching on the iPAD on WIFI with internet connection was fine.
It seems like iOS15 causes apps to verify code signing on every launch - not only the first any more.
After searching and fiddling with Provisioning Profiles for several days I found out that Apple now has two different types of certificates - an "iOS Development" certificate and a "Apple development" certificate. The latter being the "new" thing.
Deleting my automatically created certificate and creating a "new" - and then a new provisioning profile solved my problems.
My app now only needs to verify code signing at the first launch.
This fixed my code signing / developer verification issues.
iOS 15:
Settings -> General -> VPN and device manage -> business apps -> Tap on your certificate and install it.
Might be a bit late, but to anyone still searching for a solution to this problem, I finally fixed it by turning on automatic date & time settings.
On your iPhone: go to Settings  > General > Date & Time.
Then turn off and on again the "Set Automatically" setting.
For somme absurd and unknown reason that seemed to solve the problem, for me at least.
Hope it helps.
Note: I have an iPhone 7 with iOS 15.6 and i use xCode 13.4.1
Just install the Developer app on the physical host iOS device.
Go to account and signin from you developer apple id
Now under Settings > General > VPN & Device Management you'll be able to see organisations.
Trust the ones you want to
You'll now be able to open the applications signed by that organisation

Xcode 8: Your account does not have sufficient permissions to modify containers

I'm getting this error with code signing with Xcode 8:
Your account does not have sufficient permissions to modify containers
What does it want from me?
I also faced this issue in XCode 8.3.3 (8E3004b). I just went to Project Settings → Capabilities tab, then toggled iCloud off and on. Once I went back to the General tab, the errors were gone.
This seems like it may be a bug with XCode 8.
To resolve this, I unchecked the "automatically manage signing" checkbox in the of my target's General settings. I then archived my project by manually setting the provisioning profiles. After that succeeded, I went back and again checked the "automatically manage signing" checkbox and it stopped complaining with errors that made no sense.
Just had this issue with XCode 8.3.2 after we enabled iCloud Capabilities and the entitlements changed. We use automatic signing - xcode managed profile. Going into Xcode -> Preferences -> Download All Profiles wouldn't fix the problem UNTIL we temporarily made team members Admin and repeated the process. At that point XCode realized the new provisioning profile and the problem was solved.
Just goto Xcode capabilities section and see if any of the capability showing error then disable that and enable again. Then come to your Signing section in General. The issues will go now
1) Remove all automatically created provision profiles from
~/Library/MobileDevice/Provisioning Profiles/
2) In Xcode 11.1 and higher remove and add capabilities
I faced this issue in XCODE Version 8.3.3 (8E3004b). To resolve this go to project settings. In capabilities tab -> iCloud -> containers. Verify whether valid iCloud containers are selected and you have permission to access these containers. This should resolve the issue.
I was having the same problem too after I added a new device with Xcode 8.3.3 (same issue present in Xcode beta 9.0 as well). My Apple Developer account wasn't an administrator at the time either. I tried deleting my provisioning profiles and re-downloading them but that didn't work. I tried manually downloading and installing the provisioning profiles from developer.apple.com, but that didn't work either. I had my Apple Developer account made an Administrator following advice from dchappelle https://stackoverflow.com/a/43812123/5760384 and voila! The provisioning errors went away. (I'd reply to his post, but I don't have enough reputation.)
Full text of error:
Your account does not have sufficient permissions to modify
containers. Provisioning profile "myApp" doesn't include the currently
selected device "myDevice". Code signing is required for product type
'Application' in SDK 10.3
Another potential solution, depending on your needs, is to upgrade to the paid version of the Apple Developer Program; this gives you access to the iCloud container features. Once paid and activated (the membership application takes a few hours to go through if you're an individual... sometimes a few days if you're a business) you'll need to enable iCloud features via the online dashboard or via XCode as per Apple's instructions. You may then have to restart XCode.
I had the same issue with Xcode 9.2. But in my case, the problem was in Keychain: my dev certificate was saved into login keychain by default. I was able to build an app on a device only when I moved it to System keychain.
So the steps are next:
Open Keychain Access
Open login keychain (you can see the list of all keychains on the left top corner of the window)
Drag and drop your dev/distribution certificate into System keychain
You may need to input password.
PS: while doing this steps you also may need to unlock locks on the keychains.
I had this problem and I fixed it by logging in to the iTunes development portal and accepted the new Terms & Conditions. I was basically locked out until these were accepted.
I was getting this error because I was in another team (my university team account), which was severely limiting my access to developer.apple.com features. Once I left that team (I added an answers here because even this was a bit of a pain), I was able to remove & re-add my account to XCode. It then worked.
EDIT: It happened again on a new machine (an M1 mac), and this time I had left the university account. By removing and adding back "Apple Pay" capability in Signing & Capabilities, it immediately fixed itself.
None of the other answers worked for me. E.g. The app doesn't even use iCloud, and enabling-disabling it didn't help. Deleting profiles, revoking certificates, disabling/re-enabling automatically manage signing also didn't help.
Go to Xcode -> preferences -> Accounts.
Remove your Apple ID & login back. Refresh the signing in on your project target
I had the same issue using Xcode 9.3
Solution:
1 - Deselect "Automatic manage signing"
2 - Created a Provisioning profile for dev and dist and added in Keychain.
3 - Again when you come back to Sighing (debug and release) you can see your created provisioning profile in a dropdown
4 - Crate archive by selecting "Generic iOS devices" in the project schema

iTunes Connect and Xcode 8: your app has changed to invalid binary

Last week, with Xcode 7, I was able to upload without any issue. But today I am getting the message your app has changed to invalid binary.
I have seen that now with Xcode 8 a new icon 20x20 2x and 3x is added. I added one, but still getting the error.
Does anyone had similar problem?
Сheck your email!
In my case, I wasted a lot of time because I did not check my email. When you get such an error, Apple sends you an email with it's description.
For example, this is what Apple sent me:
"This app attempts to access privacy-sensitive data without a usage
description. The app's Info.plist must contain an
NSCameraUsageDescription key with a string value explaining to the
user how the app uses this data."
After days of wrestling with the same problem I finally got my app successfully submitted, but only after being on the phone with Apple Developer support.
A couple of things to keep in mind:
Make sure you set the Info.plist description keys for any entitlements. This is necessary for iOS apps. Mine was a macOS app, so this didn't apply.
Head over to iTunes Connect, and recreate all your provisioning profiles and code signing certificates if you're not 100% sure that they're valid. You can do it for both Developer and Distribution.
In Xcode, turn off automatic code signing for your app, and any build targets (you can try automatic code signing in Xcode after completing steps #2 and #4 but that wasn't what worked for me).
Go to Xcode preferences, and click your development team, and in the sheet that comes up, you should see some "Download" buttons beside the newly created (in iTunes Connect) code signing certificates and provisioning profiles. Click them all. And so you don't get confused in step #5, delete all the other stale provisioning profiles and code signing identities for this app.
In Build Settings for each of your targets, make sure that the Release build setting for code signing, and provision profile are set to the above newly created code signing certificate and provisioning profile.
Bump your build number.
Deep clean your project (Option-Shift-Command-K).
Archive build your app.
In the Organizer that opens up, select the newly archived app, and validate (it always validated, but I still would get Invalid Binary later).
Export the build and select the option "Save for Mac App Store Deployment" or similar.
When prompted, use the same Provisioning Profiles you used previously and save.
Open the .pkg in Application Loader which you can launch from Xcode > Open Developer Tool > Application Loader menu.
I was't getting any emails on the Invalid Binary issue. Instead, I was lucky enough to have set up my iPad with iTunes Connect, and so, like clock-work, I was getting notifications within a couple minutes of uploading the app: "Your app ... has changed to Invalid Binary."
If you don't get one of these Invalid Binary notifications, that's a good sign. Another 10-15 minutes later, I checked the iTunes Connect portal, and I could finally add the uploaded build and submit for review.
After a while of searching, as a last-ditch effort I added every possible 'NS...UsageDescription into each of my target's Info.plist and this seems to have worked. After process of elimination, I deduced that it was either the NSAppleMusicUsageDescription or the NSFaceIDUsageDescription key-string pair that was preventing the upload from being successful so I just added them even though I don't use either in my project. I have also read on some other threads that something with a new version of Xcode required them to have the NSAppleMusicUsageDescription even though they didn't use anything related to Apple Music.

Xcode iOS Development signing identity

I have a problem getting a iOS Development signing identity into Xcode. I have tried loads of things to get it working but I keep failing.
I have went the automatic way and let Xcode do it all but I kept going in circles where Xcode kept saying:
No signing identity found. Xcode can request a new iOS Development
signing identity for you.
Followed by:
Your account already has a valid certificate. If you have your signing
identity on another Mac, you can import a developer profile. You can
also revoke the current certificate and request one again.
I have done many steps:
Removing my account from within Xcode's preferences.
removing everything from the key chain app.
clearing everything from within the developer member center (apple developer website)
removing all provisioning profiles
removed my device
revoked all all my certificates
restarted Xcode to perform a 'Clean' project from the Product menu.
even went into my project.pbxproj file to clear anything related to PROVISIONING_PROFILE
removed all provisioning profiles from my device.
After this I went back into Xcode:
added my account into the preferences section
clicked View Details
did a refresh
Xcode automatically creates two certificates
Xcode automatically creates provisioning profiles
Xcode only creates a single Signing Identity: only for iOS Distribution.
This is my problem: I can not get an iOS Development signing identity.
After not getting it to work I went the old fashion manual way:
first clearing everything like the above
created new certificates manually, downloaded them and added them to the key chain app.
created new provisioning profiles manually, downloaded them and dropped them onto the xcode app icon.
At the end the result is the same; When I am in Xcode > preferences > accounts > view details:
I do have a distribution signing identity
I do NOT have a development signing identity
When I click the + button under the Signing Identities and choose 'iOS Development' nothing happens..
I have found lots of posts here on StackOverflow, I tried their suggestions but it won't work for me. Examples of other posts:
here, here and here
I am working with the latest version of Xcode: 6.2.
I am working on an app which is already in the App store.
Edited:
I have also changed the code signing build settings of my project and target into Don't code sign and put it back to iOS Distribution for ad-hoc and iOS Development for Debug.
Together with a very helpful person on the Apple Developer forums we have tried to figure this out.
I was so blinded by it not working, it never came to mind to try out and build another project and to see if that would work. I was completely focused on my certificates and profiles within the member center and my account details within xcode.
When I did try to build another (random) project, it worked in one go. This told us it must had something to do with the Build Settings of that one specific project which xcode could not code sign.
At the end, in xcode I went to the Build Settings of my Target. Within the Code Signing section I changed the values of Any iOS SDK to point to a specific Identity in my Keychain instead of having them on automatic (iOS Developer / iOS Distribution).
This fixed my issue and I was able to build/deploy to my device and I was able to upload a new build to iTunes Connect.
It takes a long time, and we did all the above solutions and they didn't work at all so our team decided to remove Pod files and run pod install again. finally, our OTA uploaded ipa installed on the user's device.
best Solution
clean project menu > Product > Clean Build Folder and /Users/{you user name}/Library/Developer/Xcode/DerivedData
go to your project directory and remove Podfile.lock ,Pods
folder,pod_***.framework
run pod install again
Brabbeldas, did those build setting changes end up getting the iOS Developer certificate showing in the Xcode > Preferences > Accounts > (your account) > View Details > Signing Identities pane?
There was a transient certificate generation issue resolved yesterday (March 26) at around 2:30PM PDT which restored missing Organization Unit fields to iOS developer certificates that also exhibited this symptom (missing developer certificate in the accounts > view details > signing identities pane).
If it's still missing you are probably still affected by this problem. To confirm, double click your iPhone Developer certificate in Keychain Access. The issue is still present if the certificate is missing its Organization Unit field. If your Organization Unit field is present, you're fine. The Organization Unit should be set to the value of your Team ID.
The full symptoms of this problem are:
iOS Developer certificate either shows as Revoked, or doesn't show at all in the Preferences > Accounts > (your account) > View Details > Signing Identities pane.
frameworks signed with the certificate fail to load with dyld: Library not loaded: [your_signed_framework]
Since the certificate server issue is now fixed, resolve the problem with:
revoke affected developer certificate on the website
click the "⟳" button in Xcode > Preferences > Accounts > (your account) > View Details
regenerate any custom developer profiles on the website, download and install those into Xcode
As an additional way to diagnose the problem with signed frameworks, use codesign -dvvv your_signing_framework.dylib. The TeamIdentifier field will be not set for affected certificates instead of your Team ID.

Permission Denied when running Mac app after upgrading to XCode 4.4

I had a working Mac application until I updated to XCode 4.4 and Mountain Lion. Now the application still compiles, but when I try to run it I get an error message.
error: failed to launch '/Users/username/James/mac/Browser/trunk/Browser/DerivedData/Browser/Build/Products/Debug/Browser.app/Contents/MacOS/Browser' -- Permission denied*
Can anybody explain why I might be getting this?
I found this on an iPhone 5 (iOS 6.0) newly set up for development. I had to manually launch the app on the phone, and it said "Are you sure you want to launch this app signed by this devloper?" Once I approved that, the "permission denied" went away and it now launches from Xcode.
Unlock the Device
Try simply unlocking your device before running on it. I was stumped by this very same issue. Upon building and running with no changes to OS, environment, code, etc., I was receiving the error.
Similar questions have been asked here and here, but were not helpful in this situation.
This is caused by an entitlement (and, presumably, having the wrong kind of certificate for it).
If you have the sandbox enabled, and try to sign with a Developer ID certificate, your application will crash on launch (as of Lion—I haven't tried this on Mountain Lion).
If you have iCloud enabled, and try to sign with a Developer ID certificate, your application will not launch at all—in Xcode, you'll get the error message in the question, and in Finder, the application will launch ever so briefly and then get SIGKILLed.
Presumably, there is a right kind of certificate with which one can sign an app in order to be able to test with a sandbox and maybe even iCloud that you can obtain if you have a Mac Developer Program membership. A Developer ID certificate is not that kind of cert.
(That solves my problem, anyway. Dennis, what kind of cert were you trying to sign with?)
Open the organizer and make sure you're mac is in developer mode.
Also check your gatekeeper settings.
The device is seeing the app as an "unauthorized app downloaded from the web" for lack of a better description. Go into Settings > Security & Privacy, and at the bottom, allow applications downloaded from Anywhere.
Throwing a few thoughts on the wall:
Are you perhaps building on an external disk? Some drives get special permissions (like the "ignore permissions" checkbox), or maybe have ACLs set in a weird way. Tried building on internal startup disk?
Are you code signing? Have you tried just turning that off, to see if there's a bug in code signing or entitlements? Not the first time a new codesign tool has a bug.
Have you tried using xcode-select and updating any command line tools that are installed to make sure they all match the version of Xcode used?
Do you have any shell script build phases or the likes that might be editing the application after it's been signed, thus breaking the signature?
Have you checked if your hard disk is full or there's a (broken?) symlink somewhere in a path, or a volume name that has been unmounted?
i am sure this is long been figured out, but I have been getting the Permission denied and it turned out I had to add my laptop to the provisioning profile. I had recently reimaged my machine and in doing so the provisioning profile was no longer valid for that machine. It worked fine until i enabled iCloud. That's when the permission denied started.
Check the organizer in XCODE, click on the devices tab and click on your machine on the left. Check to see that the UDID it shows is listed in the devices section in your mac developer portal.
The short answer is when you get this error message, there is no valid development provisioning profile in the built application.
That alone won't solve your problem! There are a number of common causes of this:
You've moved to a new machine and haven't installed the provisioning profile in Xcode. Also see below
You've moved to a new machine and it's not in developer mode OR not added to the provisioning profile
For both of these, let Xcode regenerate it, or do it yourself in the Member centre... You can validate the causes is something to do with your provisioning profile by running Console and filtering on taskgated where you can see which provisioning profile it is trying to use (it will pull the one embedded in the application first, then try to pull from any installed on the Mac).
Make sure you check in your build settings that the right one is being used for Debug builds. Simple steps that normally resolve (XCode 5)
Go to member centre and create a new development profile
Select the app and certificate
Validate that the machine you are using is in the list of machines to be included in the profile, tick the box
Generate the certificate
Download it, and drag it over the Xcode icon in the doc
Go to the Build Settings tab in your target and set the provisioning profile to the one you've just downloaded
You haven't configured your iCloud/APN/GameCenter entitlements correctly.

Resources