iOS: the executable was signed with invalid entitlements - iphone

So I've inherited development work for another users iOS application, and am doing my best to be able to make a working IPA file for it. I've been trying for the better part of 7 hours fighting with provisioning profiles, Entitlements errors, etc trying to get my .ipa file to install correctly, but have yet to do so. Recently I was able to get the application on my physical device by just pressing run and allowing it to deploy that way (this means that the provisioning profile and the device are all set up to work for the application, right?). Whenever I build the archive file and and distribute it as an .ipa file and try to install this .ipa through either itunes or the Iphone Configuration Utility, however, I continue to get the "The executable was signed with invalid entitlements" error. Is something wrong with my schemes or...? I think if I can't get it working soon I'm going to reinstall xcode, and clear out all my certificates, devices, provisions and just restart from square one.
This is an older project so it still had an Entitlements.plist file with it, which I've read is now longer used in xcode 4.x. I've made sure that the filepath for it isn't referenced, but should I just delete it?
I apologize if this issue has come up before, but this seems like an error message that gets spit out for a variety of reasons.

In my case, using correct provisioning profile(including device UDID), but Build Configuration was set to "Release".
So, after setting to "Build", it works.

Related

Invalid signature when submitting on Mac App Store

I'm developing a game for Mac App Store from Unity in which I have a plugin created in Xcode as .bundle file. I am able to codesign and package my game via terminal but problem appears when I try to submit package via Application Loader. I will try to explain everything thoroughly:
Package gets uploaded on iTunes Connect but at the end I get following warning:
WARNING ITMS-90239: "Invalid
Signature. A sealed resource is
missing or invalid. The binary at path
[Panda Commander Air
Combat.app/Contents/Plugins/InAppPurchase.bundle/Contents/MacOS/InAppPurchase]
contains an invalid signature. 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). 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."
I can click on "Next" and finish my submit, but this warning must be resolved because I get mail from iTunes Connect with issues that must be corrected:
UNABLE TO SIGN - This package doesn't
meet the current code signing
requirements. For more information,
see the Code Signing and Application
Sandboxing Guide [1] and Technical
Note 2206 [2].
Specifically, codesign generated the
following error:
webelinx.appstore.panda.pkg/Payload/Panda
Commander Air
Combat.app/Contents/Plugins/InAppPurchase.bundle:
unsealed contents present in the
bundle root
Once these issues have been
corrected, you can then redeliver the
corrected binary.
[1]
http://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html
[2]
https://developer.apple.com/library/mac/technotes/tn2206/_index.html
My plugin actually IS signed in Xcode, I've created new bundle ID and distribution provisioning profile for Mac App Store specifically for this plugin and setup everything in Code Signing tab. Code signing identity is 3rd Party Mac Developer Application and appropriate provisioning profile is selected. When I build this bundle it asks me to allow codesigning, and afterwards when I check it with "codesign -dvvv" command in terminal I can see codesign details. If I don't codesign it, I get another warning when I upload my package which says that bundle is not signed at all. I even tried to do a "Clean all", delete "build" directory and rebuild bundle as suggested in warning, but it has no effect, warning appears again.
How can resolve this warning? Am I missing something important or trying to fix things in wrong way?
Any help will be appreciated because I am out of options at the moment.
Thanks in advance!
OK, I solved my problem. I was missing few things and I found solution here: http://forum.unity3d.com/threads/signing-mac-app-on-os-x-mavericks.206762/.
The thing I still had to do was to manually codesign every file in Contents/Frameworks and Contents/Plugins directories inside .app file and to delete all .meta files inside my plugin. After I did these steps, I codesigned once more whole .app file and created a package which I uploaded on iTunes Connect without warning mentioned above.

Xcode IPA Issue

I having an issue with the generated ipa file.
When I generate the ipa file for ad hoc distribution everything runs smoothly on xcode, but when someone tries to download it, the app returns the error message "The application could not be installed at this time".
I tried to generate another ad hoc provisioning profile but it returns the same error.
Since I have modified nothing in my certificates could this be a xcode issue (my provisioning profile in xcode organizer are just fine)?
By the way, I noticed that after this error started to happen my IPA file has 1MB filesize and it had 1.3MB before this error started to show up.
Thanks in advance.
I have had this issue before. You need to go into your project select your target and under build settings select the appropriate certificates that you added the users devices too in the provisioning profile. These will be listed under Code Signing
You probably have it set to automatically detect which sometimes it doesn't always detect the correct cert.
Also make sure the certificates are active on the users phones. Have them go to
Settings -> General -> Profiles -> and make sure there is a green verified check mark next to it.

Another Application failed codesign verification error

I know this has been asked before but tried everything and no luck. Trying to upload my binaries using Application Loader and getting the above error.
Some interesting things for my case:
I accidentally have a space in my App name. Would this cause the code signing to fail?
Looked in the build log and the last entry is * Warning: Defaulting to the standard codesign tool. Could this be the issue causing the problem? If so how do I solve it.
Behind a corporate firewall. I have access to the net but certain ports may be closed. Could this affect it?
Tried everything except revoking all the certificates mainly because I've just created them a few hours ago.
EDIT: OK, I've recreated the entire project, I've revoked all my certificates and recreated them and installed them, I've exported the last version from subversion to make sure subversion is not affecting it, used command line tool to compress it, made the target codesign the correct profile, made the project codesign both default and the distribution profile, tried a different net connection to make sure its not the firewall.
As you can see I've tried everything I can find and the stupid thing still wont work.
Any help?
Cheers
K, This is incredibly annoying. After doing everything as I said in the question and doing some things twice decided to try the Application Loader on someone else's computer. Worked first time, didn't skip a beat.
Strange thing is I have the current Xcode (which I assume is where Application Loader comes from) and the other computer is running an old one. Perhaps the current one is broken?
I had the same issue using XCode4. Turns out I needed to Edit the Scheme and specify that the Build Configuration for Archive was to the be the one for the one associated with the Distribution Provisioning Profile - in my case "App Store".
If you're having the same problem, that may be something to check.
At the project level you want to set your code signing identity, BUT LEAVE THE PROVISIONING PROFILE TO DEFAULT.
Then at the target level you have to set both the code signing identity and the provisioning profile.
If you fail to do that the package will be signed but not interpreted correctly by itunes connect.
I too had this problem, until I realized there's a different way to upload the apps now.
My 'release' Apps build as Archives
If you open the organizer and select 'Archives' at the top, there are 'Validate', 'Share', and 'Submit' buttons in the header info for your app.
Clicking on 'Validate' added my code signing information to the app (after logging in with the appropriate developer login)
Clicking on 'Submit' ran me through the same questions the Application Loader used to ask and uploaded the app without problems. (again after signing in with the appropriate developer information)
Apparently when I updated to xcode 4, it just didn't remove the old application loader.
Rudiger has worked around his problem by updating to the latest version of Xcode, but for others experiencing the error "Application failed codesign verification", see Apple's published list of potential causes at the following URL "How do I resolve the error: Application failed codesign verification?"

Apple's Problematic Provisioning Portal

I have restarted this process about 4 times over the past 3 weeks. I have not succeeded in submitting my app to the store. Please help me! I just started over again tonight, I did it in this order:
Deleted everything referring to the IPhone in my Keychain,
Redownloaded the Distribution Certificate
Created a new app id called: com.myapp
Downloaded the Provision Profile and installed it into XCode.
Please note: I did not install an Entitlements.plist because I was told I didn't need one. Everything is looking good at this point.
Duplicated my "Release" Configuration and renamed "Distribution"
Under the Configuration of "Distribution", Code Signing Identity, I can see my Provision Profile it actually says: IPhone Distribution: My Name (for Application Identifiers: com.myapp)
So at this point at the bottom of the Project Info Window I see this:
The name (“common name”) of a valid code-signing certificate in a keychain within your keychain path. A missing or invalid certificate will cause a build error. [CODE_SIGN_IDENTITY]
So I realize I haven't altered my bundle name for my app, I change it to com.myapp, warning still doesn't go away. I tried adding in my prefix into the Bundle Identifier like this:
5JSF8843kJJ.com.myapp (for example)
But the error still doesn't go away!
After all this I try to Build and Run on my device anyway thinking it may go away. But I get this error:
The iPod “myIpod” doesn’t have the provisioning profile with which the application was signed.
Click “Install and Run” to install the provisioning profile “myprofile” on “myIpod” and continue running “myappname.app”.
Please Help! I need to get this to work!
Thank you for your time.
UPDATE: I have fully tested the app and I am ready to distribute, I am trying to get a successful Build so that I can zip up my .app file and submit it using Application Loader.
You can't run an app using the Distribution certificate or Distribution Build.
You shouldn't duplicate your Release Build until after you get it running and configured exactly as needed, except for the choice of code signing certificate.

iPhone Build Error (Entitlements)

I'm getting this error when trying to build:
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.
(0xE8008016).
This is not my first time building apps. This will be my sixth app, so this thing is tripping. I'm making an AppStore distribution build, so I dont need entitlements. I dont have any entitlement files specified in my code signing entitlement. ITS BLANK. For the project info pane and the target info pane, there is absolutely nothing in my code signing entitlements, which is how its supposed to be. Yet I still get this dumb error. Remember, this is NOT an adhoc build, rather it is an AppStore build. What can be the problem??
Do you have multiple versions of Xcode installed (such as one of the betas)? Did you change the install directory after installing your current stable version of Xcode? Xcode installs things for code signing that can break if you either install a new version of Xcode simultaneously, or you rename your /Developer directory.
Also, try checking the console for related error messages.