Trying to Upload App to Mac App Store, Invalid Binary? - ios

I'm getting ready to upload my Mac application to the Mac App Store, I've created the Application certificate and the installer certificate. When I go to validate my app, Xcode says the app has been validated and is ready to upload to the store. Every time I upload my app to iTunes Connect everything goes smoothly and the app uploads. Then the problem starts, in iTunes Connect my app state is listed as "Invalid Binary" and I receive an email from iTunes Connect saying my app was improperly signed. I really don't think I'm doing anything wrong. Right now, I have the project and the target in my app code signed, is this necessary or do I just need to sign one of them? Also, I've been having a strange issue that when I code sign the target my app builds but it doesn't run. It does not cause any error though. When only my project is signed, the app runs normally. I'm pretty confused on all of this so any help would be greatly appreciated. This is my first App Store submission so I'm excited to get an app up for sale.
Thanks for your time,
Sam
Edit: Just tried uploading the app with application loader. It uploaded to iTunes Connect but I still get the same invalid binary error. Also, I shared my archived application as a .pkg and tried to install it. I got an error saying that "This application cannot be installed on this computer". Any idea why this would happen?

You can do a:
codesign -dvvv *.app
on an app bundle directory from the Terminal command-line to see how the app you are trying to upload is signed.
Any Target setting overrides the identical Project setting for that target build. You should use a different build configuration for Distribution than for Release or Debug and running the app.

Related

iOS app upload to iTunes Connect results in Invalid Signature issue

I'm working on a hybrid mobile app project (Ionic framework) and releasing to Android, iOS and web. This issue concerns only releasing the application on iOS.
I ran into an issue whereby I suddenly started getting the following email from iTunes Connect after building, archiving and uploading my iOS app to App Store from Xcode.
App Store Connect: Your app "YourAppName" (Apple ID: XXXXXXXXXX) has
one or more issues
Dear Developer,
We identified one or more issues with a recent delivery for your app,
"YourAppName". Please correct the following issues, then upload again.
Invalid Signature - A sealed resource is missing or invalid. The file
at path [YourAppName.app/YourAppName] is not properly signed. Make sure you
have signed your application with a distribution certificate, not an
ad hoc certificate or a development certificate. Verify that the code
signing settings in Xcode are correct at the target level (which
override any values at the project level). Additionally, make sure the
bundle you are uploading was built using a Release target in Xcode,
not a Simulator target. If you are certain your code signing settings
are correct, choose "Clean All" in Xcode, delete the "build" directory
in the Finder, and rebuild your release target. For more information,
please consult
https://developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html
Best regards,
The App Store Team
I tried everything I could find on the internet regarding this issue:
Checking over my certificates, provisioning profiles, recreating them, updating Xcode, building the project again, made sure I'm using a distribution certificate not an ad-hoc certificate, verified the code signing settings in Xcode were correct, verified the bundle was built using the Release target, tried the "Clean All" option, deleted the "build" directory in the finder and rebuilt the release. In short - I tried everything I could find by Apple regarding this issue, also looked up the same issue in StackOverflow and tried a huge variety of the recommended solutions. I tried all of those options multiple times over to make sure I didn't miss anything.
Nothing worked...
Also a note that I was able to upload to App Store without any problems before. There hasn't been any changes to the project which could result in this Invalid Signature issue arising - no certificates have expired, no new ones have been created, no new provisioning profiles have been created. The same profiles and certificates were used which worked just fine some time ago. iTunes Connect just suddenly started responding with this issue.
What else can I try?
I was sceptical at first when I tried this solution but this actually solved my issue.
Find a spare USB stick or an external hard drive.
If your Mac's filesystem is APFS format the external volume using a HPFS Mac OS Extended (Journaled) file system. Move your project over to the freshly formatted HPFS external volume and rebuild it over there. This is important as if you build it on your Mac's APFS volume and then move it over to your HPFS external volume to archive and upload in Xcode this will not work!
The project needs to be built, signed, archived and uploaded ON the HPFS volume.
The uploading to App Store should now work again. It worked for me, hope it works for you as well.
See more information on the solution here

This action could not be completed. Try Again (-22421) (Xcode)

I have tried to upload my app to App Store (iTunes Connect) to test my app in TestFlight, but always appears the same error message. I don´t know what I´m doing wrong. It´s the third day I´m trying to upload my app.
Also read that this is a problem from Apple's servers, but every day is the same problem.
Please help me with this problem.
I have done it with Application Loader. First export the .ipa file, and then proccesed in Application Loader to visualize in iTunes Connect. Never works with Xcode.
You can try following solutions:
Use Application Loader to upload your app, as Xcode organizer can't upload file (rejects IPA) sometimes, without genuine reason and it's frequently occurring issue, with Xcode Organizer, that apple could not resolve permanently.
Solution to error code: 22421
Apple app upload server is not working properly (not in
connection or lost connection during file upload). Just wait and try
again later (may be after a day).
Fluctuation in your network
connection, during file upload.
You may not have added privacy
statements in your info.plist file.
Cocoa Keys: Here, is list of keys that you should consider to add in your info.plist file, if you have used that service in your application.
Nowadays, you may also face, this error code: 90186 (with app loader)
Outdated application loader can be reason of this error. Use latest Xcode tool and use application loader from Xcode Tool.
Incorrect/invalid provisioning profile, associated with your build. Ensure, your have used correct provisioning profile (A provisioning
profile with Distribution/Production mode is require. A Development mode provisioning profile won't allow your to upload app on store.)
You can find latest Application Loader Tool from latest Xcode Tool: Xcode ▶ Open Developer Tool ▶ Application Loader
try this
cd ~
mv .itmstransporter/ .old_itmstransporter/
"/Applications/Xcode.app/Contents/Applications/ApplicationLoader.app/Contents/itms/bin/iTMSTransporter"

App ID not available while upload iOS archive file through Xcode 7.3

I'm getting following error while uploading archive file to the iTunes connect. I've already uploaded the same app's archive to iTunes twice, second time with different bundle version. And my internal test users were able to download and run the app just fine. But now I'm getting this error and I can't put my finger on something I'm doing wrong. Please do help me identify. Thanks.

Unable to upload app to iTunes Connect - iTunes Store operation failed. Authentication timeout

I'm trying to upload my app to iTunes Connect with Xcode. I chose product > archive, choose my account, it compiles and when I try to upload it hand for a long time on:
Uploading Archive
Sending API usage to iTunes Connect...
Then it shows an error message:
I've restarted Xcode and the entire machine but still it keeps repeating itself.
What's wrong here?
This usually happens to me when the phone is connected while uploading the archive, and removing the phone so far has been solving the issue for me.
My solution was to install Application Loader. At first it seemed like it's stuck as well, but after about 10 minutes it started uploading.
I solved this issue.
There is a checkbox "include bitcode" at the bottom of the Summary screen (when you validate Archive) or Send XXX to Apple screen (when you upload to App Store) where the Organizer show the Binary and Entitlements together with Provisioning Profile. In XCode 7 it is checked by default. I unchecked it and re-run Validation - worked fine. As soon as checked the checkbox back on, it started failing with same error.
I have also unchecked the other checkbox on the same screen - symbolis upload.
Successfully uploaded the binary using the Organizr just now.
Here the solution that helped in Xcode 8, summary screen:
Still getting the same error despite "unchecking" bitcode and also archiving with the bitcode under Basic Profile turned off in the info.plist.
It would only work if I used Application Loader, like this:
First, export the application Archive from Xcode's Organizer window (it saves this into a directory on the Desktop).
Then, from Xcode:
Xcode > Open Developer Tool > Application Loader
My guess is that there is a bug somewhere either with iTunes Connect back end or xCode itself.
A couple of Xcode restart didn't resolve the issue but Application Loader solved it for the very first attempt. Also, Application Loader, is more descriptive for letting one know what's going on during the whole upload process. Plus simultaneous apps upload is possible via Application Loader.
I got this error when trying to upload an app to App Store Connect (01/20/2020). Restarting Xcode fixed the issue for me.
I've had the same issue.
Tried to upload the app with Transporter with no success.
Restarting of Mac and Xcode didn't help.
Solution was to logout from Xcode and log in back
Xcode -> Preferences -> Accounts -> Select your Apple ID and click on "-" below
To submit to App Store use Application Loader but after creating the "App-Specific" password as the following:
Log in to https://appleid.apple.com and enter your 2FA (TWO-FACTOR AUTHENTICATION) code.
Then in the Security section on the bottom right area, you'll see: APP-SPECIFIC PASSWORDS.
Generate Password... Click the link to create an app-specific password, Enter your password.
Copy the app-specific password. Enter the password into the Application Loader.
Choose the exported ipa to submit it.
For developers uploading apps with Xcode: simply change network and restart your Mac.
I solved this issue with Transporter, native Apple application. You can download it from AppStore.
https://apps.apple.com/ua/app/transporter/id1450874784?mt=12
This application has a much more information about uploading process and possible errors.
Install the "Transporter" app from the MacOS app store.
From Xcode's organizer, select your archive and press "Distribute App"
Select "Export" and proceed as usual.
Choose the exported .ipa file into the transporter and press "Deliver".
I was getting the same error. Application Loader didn't work. I couldn't open any Apple Developer/Forum webpages either to find an answer there. And iTunesConnect wouldn't let me log in. I thought the site was down and I couldn't even access the Apple Status pages.
My VPN was connecting outside the US. After turning off the VPN everything returned to normal. I have been letting the VPN connect to random places around the globe, probably should keep it in my area.
In my case, The build with the same number (e.g. Version 1.0(1.6)) was already been uploaded to AppStore. I found that after logging into itunes and checked the TESTFLIGHT BUILDS -> iOS and there I saw 1.6 (Processing)
Note: 1.0 is the version number and 1.6 is build number.

Bundling app for app store distribution in Xcode 4.3

I can't believe how difficult it is to figure out the final process for building an app and getting it into the app store.
I've already prepped iTunes Connect with my app and it shows up in Application Loader.
I finally figured out how to "archive" the app, although none of the guides I found, including Apple's, seemed to really describe this process in complete detail.
Now I've got a .xcarchive package. For some reason, Application Loader will not let me select that kind of file. I read somewhere about needing to archive as a .zip file, so I tried that. Now Application Loader allows me to select the file, but after I click Send, it gives me this error:
"The application wrapper must end in .app."
What exactly is the process of archiving from Xcode 4.3 and getting the application uploaded into the app store?
In the XCode Organizer, does the 'Archives' tab allow ou to 'Distribute'? You should then have the option to 'Submit to the iOS App Store'.
This is described in more detail in Distributing Your iOS App.
The submission process doesn't get a lot of description because, when it works, it's quite simple. You never need to manually locate the '.xcarchive' package or '.ipa' file for your app store submission, only for testing or backups outside the app store. (You do need the archive package, but it's just quietly created and then uploaded by XCode.)

Resources