Failed to verify code signature - ios

I've been working on this app for a few months now and one of every few builds that I push out through the new Test Flight in iTunes Connect can't be installed, and when I connect my device to my computer to look at the console, I see the error message
"Failed to verify code signature"
With the supplemental message:
Entitlements found that are not permitted by provisioning profile
I don't understand why this is an issue only sometimes. I seem to correct the issue by creating a new identical, aside from the build number, version and upload that.
What could I possibly be doing wrong? The only "entitlement" my app registers for is access to the keychain, but there is no toggle for that in the entitlements potion oft he application identifier on the developer portal.

Related

Notification Service Extension unable to use Call Extension, profile team id differs from app prefix id

I'm working on an out-sourced application for a company and when a version of it built using ids and provisioning profiles from my Apple account it runs without problems.
However when it is built and run using the company's ids and provisioning profiles I am seeing an issue with it.
What is happening is when a notification service extension uses a call extension then the OS logs the following:
doQueryCallExtensionStatusWithDispatchGroup() COMPLETED WITH ERROR: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.CallKit.CallDirectory was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo=
NSDebugDescription=The connection to service named com.apple.CallKit.CallDirectory was invalidated: failed at lookup with error 159 - Sandbox restriction.
I noticed that in the company's provising profile for the notification service extension the app identier prefix is different from the team identifer. In my own provisioning profile the app identifier prefix and team identifer are the same. Could it be the case that this difference in identifiers within the provisioning profile is leading to the sandbox error message?
Attached is the notification service extension provisioning profle provided to me by the company (converted to a .plist for readability)
I was getting this error with the new WeatherKit service today. It only started appearing once I had pushed the build to Test Flight. Building it on Xcode and on my device yielded no problems.
I looked around, and figured out that I hadn't added the WeatherKit capabilities into my app itself. Once the capabilities had been paired to match my Entitlements and what services I'm registered for on the Developer Portal, the error went away and the app runs as expected on Test Flight.
So if you're seeing this error now, I'd check that your app's capabilities are properly reflecting the services you're using.
Yes, the provisioning profile for the push extension and the app should be for the same app and use the same certificate and from the same team.
You should ask them to export their certificate & private key to you. And then either download the provisioning profiles from their iOS dev center or generate one if you have access to their portal.

App Center iOS build unable to verify integrity

I'm working on a Xamarin application and I'm doing iOS builds to run and test on different devices using App Center.
Everything was ok, on Apple Developer I created the Ad-Hoc certificate, the provisioning file, and the identifier and it was all good.
During the last implementation, I added on Entitlements the Associated Domain due to enabling the possibility to use the App Link and let the user open the application using a link provided via email.
I updated the Identifier adding the feature also to it and I downloaded it and uploaded it again to the dedicated branch on App Center, but now when I try to download the app to the device I receive this message:
Unable To Install "App Name". This app cannot be installed because its integrity could not be verified.
I tried different ways trying to solve it:
Create a completely new certificate with a new identifier, provisioning, and .p12 file
Checked Entitlement feature list correspond to the identifier list on Apple Developer
Used different versions of SDK and Xcode on App Center
I already searched around on the web but they talk about the provisioning file list but I already checked and it is updated.
Thank you for your help and for your suggestions.

codenameone Preferences throwing "Failed to save token" Error

I try to create new apple certificates and it says "Failed to save Token" Error. I have login to itunesconnect.apple.com and successfully accepted the agreement before trying this.Please advise when this error occurs.
There used to be space in the project name and did worked before without any issue and deployed application in app store. Now my certificate got expired. when I tried to regenerate the certificate using the codenameone certificate wizard, it popped error saying path contains space. So I went and deleted the space in the project name and corrected Build.xml and codenameone_settings.properties without space manually. When I tried to connect itunesconnect through codenameone wizard it failed with error "Failed to save token". I have updated AppID in apple itunes connect without space as well to match it. Please advise
The certificate wizard should work now. We had some downtime as I explained here: https://www.codenameone.com/blog/native-logging-certificate-wizard.html

Testing Push Notifications, sharing app internally with coworkers

I've made a very basic app for push notifications using my personal ios developer account. I wanted to share this with a remote coworker but it's proving to be a struggle.
I added his device to my developer account, and I've created a new provisioning profile with his device for my app.
I sent him the certificate, and he ran it on his computer.. and then built the app on his phone. He got this error:
Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0x17007e880 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
i had him check Xcode -> Preferences -> Accounts and this is his screen. I think he has an expired developer account, but can somehow still build apps on his phone??
he doesnt want to pay the $99. I'd add him as a developer on my "team" but I have an account as a single developer. What is the easiest way to get this working?
Here is the link that would help you build ipa that you can share with your coworker.
Or submit your build on iTunes connect and share it via test flight.
And one more thing you should keep in mind that as you mentioned that this app supports push notifications, i hope you have placed development or production SSL certificate on server which is necessary to send notifications from serve to device.

ITMS 9000: The binary you upload was invalid

When I ran into this issue, my first thought was to search Stack Overflow for solution. I did the search, found several topics. But, unlike my issue, those posters got some clue from the error such as,
App Store error: The binary you uploaded was invalid
Invalid iPhone Application Binary
Uploading Binary iPhone App "The signature was invalid" again again and again
The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate
Or this one:
"The binary you uploaded was invalid. the file was not a valid zip file" Error message uploading app to iTunes Connect
The binary you upload was invalid. the file was not a valid zip file
Or this one
CFBundleVersion in the Info.plist Upload Error
The binary you uploaded was invalid. The key CFBundleVersion in the Info.plist file must contain a higher version than that of the previously uploaded version.
But for me, I got nothing, it just says ERROR ITMS-9000: "The binary you uploaded was invalid"
I try to resolve this issue by the following attempts, all of them failed
Test on simulator make sure the app works ... Check!
Test on device (iPhone 5S, iOS 7 and iPhone 4s iOS 6) to make sure the app works ... Check!
Clean and build ... Done!
Make sure that I'm using distribution profile (not ad hoc, dev) ... Check!
Redo the whole process of certificate and provisioning profile ... Done!
Check my code signing identity ... Check!
Check bundle id, there are matches (Xcode == App ID in Apple Developer == App in iTunes Connect) ... Check!
App ID case sensitive check .... Check! (lower case, com.companyname.productname)
Delete target in project and then create a new one (I have one project, multiple targets) ... Done!
Delete scheme and then create new one ... Done!
Check icon size, check loading image size, check pixels per inch ... Check!
Check Localizable.strings for typo ... Check!
Delete build foler ... Done!
Restart Xcode, restart computer ... Done!
Connect to another wifi router ... Done!
Submit from my colleague Macbook ... Done!
Create new App ID, new certificate, new provisioning profile and update iTunes Connect Bundle ID ... Done!
Take a break for an hour, try again ... Done!
I really have no idea what did I do wrong. I've been submit app since iOS 4, hundreds of updates. But never ran into anything like this. In fact, I've just update another app yesterday which share the same codebase with this one, no issue at all.
Is there a way I can gather more information about "the invalid binary" Xcode is telling me? Or is there anything else I should try?
For everyone who found this topic (18 July 2014), maybe your best shot might be, taking a break for few hours (or a day) and try again.
--- Last Update ---
It turns out to be Apple Server issue
Says, I have an application called "Sample App"
This app has an app id of com.tartw45.sampleapp
This app use an App Store Distribution profile called "Simple App App Store Distribution Profile"
Back to last Friday (18 July 2014), everything seems ok, no indicator of any error but I couldn't publish the app as I stated above
Today (21 July 2014), I tried again with archive from last week, still no success.
I decide to redo the archive process and I found that "Simple App App Store Distribution Profile" is no longer valid
I login to developer.apple.com and found that "Simple App App Store Distribution Profile" also no longer there in the list of all provisioning profile. **
Then I try to create a new provisioning profile with the same name (Simple App App Store Distribution Profile) but there is an error says that this profile is already exist, please choose another name **
So, I create a new provisioning profile with slightly different name, refresh the provisioning profile in XCode, archive again and then publish .... Works!
So, It's definitely Apple Server issue and your provisioning profile (**), it has nothing to do with your XCode version or project setting (if you successfully submitted your app once before running into this issue with no reason). So, anyone who found this topic, please try to validate your provisioning profile and try to publish again.
I was having the same issue since last night and finally got it to work just now. Had to go through this process
Logged in on https://developer.apple.com> > Certificates, Identifiers & Profiles > Provisioning Profiles and revoked my company's Distribution Certificate.
Then Xcode > Preferences > Accounts > Apple IDs > (my company) > View Details and refreshed the certificates and Provisioning Profiles. It prompted that no Distribution Certificate was found on the Developer Profile and offered to request one on my behalf, which it did.
Launched Keychain Access > Certificates and removed all of the expired Certificates (somehow I had a few of them)
I went back to https://developer.apple.com> > Certificates, Identifiers & Profiles > Provisioning Profiles and edited all of my manually managed Provisioning Profiles (Development — which had to be re-generated — and Distribution — which had to be linked to the newly created Distribution Certificate and generated again)
Once again Xcode > Preferences > Accounts > Apple IDs > (my company) > View Details and refreshed the certificates and Provisioning Profiles.
Credit to Rodrigo on the apple dev forums
iTunes connect (or at least some services that iTunes Connect uses) are down for the moment, so "Take a break for an hour, try again ..." is your best shot. Apple of course doesn't update their status page until tomorrow or so.
https://developer.apple.com/system-status/
It's on Apple's side. I tried to validate a couple of apps that worked last night, no changes in code, credentials, or Xcode and this is what I get.
We found it wasn't necessary to revoke anything- when I went to Provisioning Profiles->Distribution, the two profiles for our two apps we were trying to release had been removed. I recreated those profiles (but I had to assign new names, using the old name led to a "profile already exists" message- so those identifiers are still out there- somewhere). Downloaded and installed the new profiles, resubmitted the archives we made on 7/18/14, and everything sailed right through.
Apple iTunes' Connect server is down at the moment. I have tried almost everything, but all failed.
I suggest as above to take some rest and try upload after an hour or so.
I ran into the same error when I tried validating my app. I got a message saying,
Unable to process app at this time due to general error
I searched on SO for this and only found a suggestion to wait for some time, as this is an error from Apple's servers. I tried all sorts of things, from playing with provisioning profiles to improving app performance and linking libraries, none of which resolved the issue. Unfortunately, I guess we don't have any other options than to wait and let Apple do its work.
Yesterday, I had to regenerate an expired distribution certificate and got errors each time. Now it works, but I got the invalid binary error. It looks like Apple have done some changes and missed up something.
There might be a link between a change in certificates yesterday and the invalid binary error today, which gives a possible explanation of this problem.
I've had the same issue and have found out that my Provisioning Profile for Distribution "somehow" disappeared from the Apple Developer Portal. But when I tried to re-create it, I received error message about the existing one (which I couldn't find at all).
Finally, I've just created a brand new Distribution Provisioning Profile, downloaded and installed it. In the end, I was able to validate the application package and upload was successful.
Just spent a while on this also, my upload previously worked and managed to get through validation.
However, once up Apple would fail/reject the uploaded binary due to something similar to the below
https://stackoverflow.com/questions/18952213/invalid-directory-name-your-app-contains-a-directory-name-that-is-already-rese#=
Upon retrying, later without making any modifications, rather then sucedding then failing after validation I started receiving an error exactly the same as the OP.
Fixing the framework reference issue, enabled me to succesfully upload.
So rather then uploading passing validation and then being rejected, it would not pass validation, and I give the same error, without any hints.
Hopefully this helps someone else.
In my case I updated my Mac version and it worked fine afterwards.

Resources