Application Loader gives error: Not a valid zip file - ios

I'm trying to submit an app (.ipa) and the only error Application Loader gives is "Not a valid zip file." It doesn't say anything about signatures, provisioning profiles, certificates, or binaries, etc. What is the problem?

If you're emailing the .ipa to your client, make sure it isn't getting munged either by their email software/server or by yours. You may want to zip the .ipa (even though the ipa is already an archive format) in order to get the file to them without it being modified. Then they can unzip it and submit the ipa file. My guess is that the .ipa file suffix isn't being recognized by someone's mail software and that's damaging it somehow.

If your zip file name has a space in it, e.g. My App.zip, try renaming the zip file so that it has no spaces, and try to upload it again. I seem to recall this happening to me once, and this did the trick.

Related

Is that safe to share .xcarchive?

I`m somehow amateur in Xcode and this matter is so important for me.
My Friend use his developer id to publish my app and he ask me to give him .xcarchive instead *.ipa file
As I read in stackoverflow topics .xcarchive have the same content of ipa and there is no concern about lose and steal source code.
But when I check my xcarchive and use show content option I see most of project files like images and sources in application folder , also some of my code are in *.nib files
Is that normal ? and if I extract ipa if I get the same result ?
Is there any security or tips in Xcode that better to active before archive project ?
It is normal. In order to publish your app, your friend really needs the xcarchive, because they need to export an IPA file with the appropriate provisioning profile and signed with their code signing identity. Although it's possible to replace the provisioning profile in an IPA file and re-sign it again, it's a daunting task you don't want any of your friends to do. If you trust your friend with publishing your app, you should trust them and share the xcarchive.
When you compare the contents of xcarchive and IPA files, you can see xcarchive contains a dSYMs folder with dSYM files used to desymbolicate your crash logs -- the developer needs that to know in what file and at what line number the application crashed.

Add file to already packaged .ipa

As the title says I'm looking for ways to add an additional file to an already packaged .ipa.
We need this for an in-house app to add a saml certificate to the ipa so that the user doesn't need username/password any more to log in.
Adding the file on the server when the download request comes from the user isn't the issue, the problem is, that the ipa won't install on the device any more.
I've read in the Apple documentation that you can omit certain files from being signed, so I extracted the ipa using "The Unarchiver" on a Mac, and added the following to the ResourceRules.plist;
saml.txt
omit
weight
200
I also tried omitting all txt files, as described here: http://lists.apple.com/archives/xcode-users/2011/Apr/msg00277.html
(^Resources/.*.txt
omit YES
weight 200")
First off, I don't really know what rule the weight property plays. I wasn't able to find any documentation about this.
Anyways, I saved the file, compressed the Payload again using the tools OS X provides and renamed it to the required ipa filename.
Unfortunately, the ipa won't install on a device. It downloads fine, but installation fails.
What am I doing wrong here and how to I overcome this issue?
Since it probably matters, the ipa is generated with Flash Builder, so I don't have all the build settings available that XCode has.
If someone's got a hint, please let me know!
Cheers!
Finally found a proper solution.
This is a step by step guide to add or alter files to the already packaged ipa;
Rename the .ipa package to .zip
Extract the .zip package
Go into the Payload's app content's directory and change the ResourceRules.plist file to your needs. In our case, we needed to add another file to the list of excluded files.
File.txt
omit
weight
10000
Using Apple's codesign, re-sign the package with the new ResourceRules:
codesign -f -s "iPhone Distribution: cert name" --resource-rules "Payload/AppName.app/ResourceRules.plist" "Payload/AppName.app"
Zip the Payload again.
That's basically it. Now you can alter "File.txt" as long as you want without invalidating the ipa package.
.ipa file is a packaged "zip" files in other words. Which contains all of your application codes and all the .h & .m files. So it is basically a zip file of your complete xcode project.
Now once the file is zipped (.ipa) file its not possible to add any thing till the time the file has been extracted.
And no one in the world except Apple can do add files to a .ipa file.
Hope this will help you.

Failed to find app bundle in zip file

Recently,I have upload an iPhone app to apple store.When I finished uploading.I received a email from apple. Warn me that the binary is invalid due to "Failed to find app bundle in zip file". Try upload several times, but still the same problem. I wonder If any one have this problem?And how to solve this problem.Thanks.
The email is here:
Dear developer,
We have discovered one or more issues with your recent delivery for "XXXX app(With Chinese)". To process your delivery, the following issues must be corrected:
Failed to find app bundle in zip file - The zip file you submit must contain exactly one .app bundle, and the .app bundle must reside at the top level of the zip file, not nested in a subdirectory. The best way to accomplish this is to create the zip file by selecting your .app bundle (e.g., MyCoolApp.app) in the Finder and choosing "Compress MyCoolApp.app" from the File menu.
Once these issues have been corrected, go to the Version Details page and click "Ready to Upload Binary." Continue through the submission process until the app status is "Waiting for Upload." You can then deliver the corrected binary.
You need to check bundle in Provisioning Profile as well as in app bundle id.Both are must be same.
Please check it, it is correct or not.
After that You are able to upload your binary on App Store.
Good Luck !!!!

iOS App distribution - Archiving an .ipa file

I have an .ipa file which is signed with an Enterprise Certificate and using an inHouse distribution profile. I do not have the original source code with me. When I went through the distribution article in Dev center, I understood that it has to be archived for distribution purpose. I do not know how to archive an .ipa file. Could you please assist me in this? I'm new to this iOS development world.
I am going to assume everything was built and signed properly, with the proper provisioning profiles and distribution certificates.
You need the myApp.ipa and the myApp.plist generated by XCode, there may be others ways, but generating these via Xcode is the easiest. Once you have both of these files, upload them to your server (e.g. public_html/app/myApp.ipa and public_html/app/myApp.plist).
Your users navigate to your download page via Safari. On this page you include a link like the following:
Install the app
It is pointing to the myApp.plist. This must have (among other things) an item like the following (not sure about the exact format at the moment, but it is easy to spot if you open the .plist file in text editor):
<key>url</key>
<string>http://mydomain.com/app/myApp.ipa</string>
This URL is also usually added during the archive in XCode, but it can be easliy edited. It points to the .ipa (which really a zip file containg the executable and other resources like images).
When users tap "Install the app" in Safari, it will read the plist file, and if everything was successful up to this point, will prompt the user to install the application.

Problems creating an ipa file

I want to create an ipa file but I get the following error message. Maybee someone knows what's going on here? Or just a hint where the error might be.
Sometimes it may happen that Xcode Archiver fails to generate ipa file. Then here is the another option.
Build the application.
After successful build go to "Products" folder in your project navigator.
Right click on it and go to "Show in Finder".
Copy the .app file.
Create a new folder at some other location lets say on Desktop with name "Payload".
Paste that .app file in Payload folder.
Zip the Payload folder.
Rename that zipped folder with .ipa
Thats it.
Reverse procedure is used to retrieve the app file from an ipa file.
Hope this answer helps.
Check to make sure you have changed your Code Signing Identity to a Distribution profile, rather than your Developer profile cert. You need to explicitly create a Distribution cert in the provisioning areas of the Apple Developer website.
Here are two links that are pretty helpful, first and second.

Resources