Missing or invalid signature in iOS - ios

I have not found any functional solution, between a great number of suggestion on internet. I don't know exactly where and when it stopped to work, but I have an app at Apple Store that is working fine and it is in the 1.7 version. One month ago, I have tried to implement Push Notification and, to this tool works, I have to create and manipulate some certificates (Apple Developer certificates, Keychain Access, etc). After that, when I try to upload a new version to Apple Store using Xcode, I receive the message “Upload Successful”. Some minutes after this, I receive this message in my email:
Dear developer,
We have discovered one or more issues with your recent delivery for "Habilidades Médicas". To process your delivery, the following issues must be corrected:
Missing or invalid signature -
The bundle 'com.IvanSinigagliaApps.ChkList' at bundle path 'Payload/HabMed.app' is not signed using an Apple submission certificate.
Once these issues have been corrected, you can then redeliver the corrected binary. Regards, The App Store team”
I really don`t know what I did. Maybe, I can have deleted a key (keychain) or deleted a certificate or both. All the posts I have found about “Missing or Invalid Signature” didn’t work for me; many don't push me to my issue and many other are out of date for Xcode 8.3. I will post some screens with some doubts I have to show most information I can and I hope they can work as clues to help me to fix it.
Fig 01: My Keychain Access: I can found to Certificates: 1) iPhone Developer: QRL…, and 2) iPhone Distribution: C3D….
Fig 02: Apple Developer Provisioning Profiles:
Fig 03: iOs Certificates
Fig 04: Xcode (Certificate iPhone Developer QRL… ) ???
Fig 05: Xcode: even when manual provisioning is set up (C3D…) it doesn’t work.
Fig 06: Uploading App (Signing identity Distribution C3D…
Fig 07: Uploading (C3D…)
Fig 08: Upload Successful
UPDATE #1
This is happening the same way to my 4 apps, that were loading fine before.
Still not working, but after following the instructions at Apple Developer Troubleshotings technical Note TN2318, section: Resolving Signature Verification Failure, I run the Terminal with these instructions:
codesign --verify -vvvv -R='anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.1] exists and (certificate leaf[field.1.2.840.113635.100.6.1.2] exists or certificate leaf[field.1.2.840.113635.100.6.1.4] exists)' /path/to/the.app
I receive this message: code object is not signed at all
Now, I will try to go on this clue.

Yes, it is done, after a lot of hard work.
I have a great help from Apple Developer technical Support and to short this issue what I did was trying to fix it editing my certificates. As the problems involved all my apps, it should be something with the certificates. So, the guy from Apple, John, told me to think about this information:
I see they were issuing an revoking their certificates throughout May
and created the latest Certificate on June 1st. It is currently the
only active certificate. When a Distribution/Development Cert is
revoked, the associated provisioning profiles are invalidated and the
apps will stop functioning. This is the expected behavior. Apps
distributed via the App Store are not subject to this behavior. Only
apps distributed using the Ad-Hoc distribution method.
So I went to my certificates, at Apple Developer site, and edited those that I had just revoked and edited them again. A new one was created for this particular app and I have downloaded it to my machine. I have done a new upload and now everything is working fine again, with all apps.
There was a big confusion with all my certificates and with all my apps that. This confusion came to create this issue. Now I have reorganized all this stuff and everything is fine.
That's my lesson from this issue: keep all your work organized.
I really hope someone with the same issue can fix them after reading all this post or at least find an orientation.
Thank you Apple Developer Support and everybody who has read this.

Related

Renewing Apple Certificates

As usual, Apple's over-complicated procedures are driving me mad.
We have an app that uses Push Notifications (amongst other certificates). This ran out 2 months ago but we have been unable to get a new certificate working which is, needless to say, ridiculous.
I have added new certificates to the Apple ID Developer account, generated p12 files, added to Keychain, converted to .pem file, etc but the app still fails. I don't know if we are generating the wrong certificate or storing in wrong place or not linking it to app etc.
Can someone please make themselves a hero for all us standard app developers by listing the full and precise steps to getting new certificates found by Xcode and the app build?
Thanks.
LATEST
Ok so still a duff app. Have cleared certificates, made new provisioning profile, made new certificates, added to keychain, copied to system keychain (whatever that is but they seemed to be there before)....
Errors are as follows.
Target > Capabilities > Push Notifications
Target > General > Signing
Both say 'Provisioning profile "xxxxxx" doesn't include signing certificate "iPhone Distribution: xxxxx. (M........6)'
Don't know what I should be doing with anything after adding to Keychain and no idea why I can't add certificates to a profile. Push Notifications is enabled on App ID.
Here is the full and precise steps to getting new certificates you want.

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.

APNs Dev and Prod Certificate issue

So, I've done a zillion ios apps with push notifications and I've never run into this:
In the past, when I download the APNS cert (development or production), it showed up in my keychain as:
Apple Development IOS Push Services: com.YYY.ZZZZZZZZ
where YYY.ZZZZZZZ is the bundle identifier. Now, however, the certificate shows up in the keychain as:
Apple Development IOS Push Services: XXXXXXXX:XXXXXXXXX
where XXXXXXXXXX is our apple developer team id. It does this for each certificate I download, even ones that used to show up correctly, which makes it impossible to tell one from the other. Strangely, the certificate title looks right in the developer portal.
Additionally, I notice that X-Code is crashing in the Organizer > Provisioning screen when I hit the refresh button in the lower right, but this may be a red herring.
Has anyone run into this and come up with a solution? I've seen other complaints about this in the last few days on the Apple Developer forums, but not seen any resolutions and I'm hoping the resident stackoverflow geniuses will come to the rescue...
UPDATE
To fix the XCode refresh error, run this command in the terminal (per this post at Apple):
mkdir ~/Library/Developer/Xcode/OldPortalDBs; mv ~/Library/Developer/Xcode/connect1.apple.com* ~/Library/Developer/Xcode/OldPortalDBs
The bizzaro world apns certificate problem still remains, however.
UPDATE II
You can "Get Info" in the context menu on the certificate in the keychain to see the bundle identifier, which makes finding the one you're looking for a bit easier.
APNs Certificates look different in login keychain If this is the answer to your question then I ask that you please do some research before posting.

Can't upload iOS app to the iOS app store

I'm having a really difficult time trying to get this app loaded to the iOS App Store. I'm so soured on this idea of keychain's and certificates and provisioning profiles, this might just be my last iOS app. Nevertheless, I would like to try to upload this app to the app store I spent the last 3 months on. Anyways, I have a plethora of problems no matter how I try to attack this.
When I download a certificate from the dev center after creating a developer provisioning profile and doing the whole Request Certificate From a Certificate Authority thing, and try to double click it, nothing happens and it doesn't upload to my KeyChain. Keep in mind that this is the only Apple Computer I've ever used in my life.
When I try to create a Distribution provisioning profile, as per Apple's tutorial, I get Valid signing identity not found, in Organizer Provisioning Profiles.
When I try to validate or distribute from Archive in Organizer, it keeps pestering me for a Developer's profile, which I don't have. And Apple's dev center is of zero help when I try searching for this topic.
What am I missing?
Apple has an Entire Technical Note 2250 related to troubleshooting code signing issues that has always been helpful to me.
try this http://www.youtube.com/watch?v=THKpJrMu204 it's a series of 5 videos for submitting apps. Best tutorial that I've seen – user784044

Certificates Problems: Apple WWDRCA certificate "signed by an unknown authorith"

I've been having trouble re-establishing my build environment. It's worked fine in the past, but in the midst of running archive processes, I've managed to throw myself back a couple of days.
I've done TN2250 patiently.
Everything goes smooth — except no matter what I do, the Apple WWDRCA.cer shows up in the login (default) keychain in my Keychain Access as "This certificate was signed by an unknown authority." I've tried getting the certificate from a link from Apple's iOS Provisioning Profile as well as hard links — not that it should matter, but I'm desperate at this point.
My developmer and distribution certificates appear to be fine — there are no errors next to their view in Keychain Access and they contain my private keys, as best as I can tell (click arrow, down it goes, there's my key.)
I notice this even before I add the certificate. I mean — it's coming from Apple? It's a file. Why would it not be signed correctly?
The errors vary with the various things I try. But the recurring one is
CSSMERR_TP_NOT_TRUSTED codesign failed with exit code 1
I've tried & referred to:
CSSMERR_TP_NOT_TRUSTED error
and the specific points in TN2250 here:
https://developer.apple.com/legacy/library/technotes/tn2250/_index.html#//apple_ref/doc/uid/DTS40009933-CH1-TNTAG19
Just seem to have figured this out. I haven't seen this answer anywhere, so I'll answer my own question. It seems as though my Keychain was missing a valid "Apple Computer, Inc. Root Certificate" and "Apple Inc. Root Certificate". As soon as I installed these, my certificates became "green" and valid.
I got these certificates from here: http://www.apple.com/certificateauthority/

Resources