iPhone Build Error (Entitlements) - iphone

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.

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.

iOS: the executable was signed with invalid entitlements

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.

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.

The executable was signed with invalid entitlements (iPhone build)

Ok I'm no rookie to this stuff. I know what I'm doing, so please dont take me through the basics. I updated Xcode to the newest version the other day, and now every new project and saved projects from the past that HAVE succesfully been built using its own distribution certificate are no longer succeeding with the following error:
The executable was signed with invalid entitlements.
The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.
(0xE8008016).
This is happening to ALL my apps! I have six of them, and all of them have never had problems with their certificates, but now I'm getting this error! I'm not even making adhoc builds, so Im not using entitlements, nor is it specified in the code signing entitlements box. That box is blank. Ive tried everything, this is definitely an Xcode issue with updating.
Please help this is extremely frustrating.
This is just a shot in the dark, but maybe try deleting all of your provisioning profiles from Xcode and all of your devices, then download them again from the provisioning portal and reinstall them on everything? I ended up doing that anyway when I upgraded.
In my case I had "code signing" line in my targets and project build settings. Despite it was empty it was still giving me this error, until I deleted it completely in targets and partially in project. So that is what I did:
In Xcode 4.2 I went to my PROJECT\Build Settings found that line "code signing", clicked on it and in Entitlements deleted all lines (they were empty but still there!), so Entitlements disappeared.
I put in "code signing identity":don't code sign
"debug":don't code sign
"Any iOS SDK": choose your provisions here, I used automatic, worked fine
"release":don't code sign
"Any iOS SDK": same as above
Then I went to TARGETS\Build Settings, found the line "code signing" and deleted everything under it so it disappeared from targets.
Now I could build onto the device, not only in simulator.
Hope it helps somebody.
B

The executable was signed with invalid entitlements

I am having a problem with ad-hoc distribution on my iPhone. I have developed an application with SDK 3.0. I have a developer's license. I have added certificates and provisioning profiles in my project. So, no problem with that.
But, when I try to install the app on my iPhone, it compiles the project and then displays the error: "The executable was signed with invalid entitlements" in the Organizer window. Am I missing something? I have upgraded my iPhone from 2.2.1 and have downloaded latest SDK from Apple.
Please help me with this issue.
There are pretty good instructions in the 'Portal Program'. If you log into
http://developer.apple.com/iphone
Then click Distribution on the left, and click the
Creating and Downloading a Distribution Provisioning Profile for Ad Hoc Distribution
link at the bottom.
Here's the key bit:
For Ad Hoc Distribution, complete the following:
In the File Menu, select New File -> iPhone OS -> Code Signing -> Entitlements.
Name the file “Entitlements.plist" and click ‘Finish’. This creates a copy of the default entitlements file within the project.
Select the new Entitlments.plist file and uncheck the “get-task-allow” property. Save the Entitlements.plist file. (in Xcode 4, get-task-allow is called "Can be debugged" )
Select the Target and open the Build settings inspector. In the ‘Code Signing Entitlements’ build setting, type in the filename of the new Entitlements.plist file including the extension. There is no need to specify a path unless you have put the Entitlements.plist file somewhere other than the top level of the project.
Click ‘Build’. (Note: Your binary must contain a flattened, square-image icon that is 57x57 pixels. This icon is displayed on the iPhone or iPod touch home screen.)
This error also may occur if you're trying to profile an app where the device is not included in the provisioning profile.
Make sure your device is included in the dev provisioning profile you want to use. Somehow the error message is misleading. My entitlements were actually ok.
I have found that "get-task-allow" needs to be checked for Development builds but unchecked for Distribution builds. The easiest way to accomplish this (AFAIK) is to have two entitlements files in your project: Entitlements.plist and EntitlementsDebug.plist - and to reference the proper one in the build project settings for the various configurations in your project.
Code signing entitlements are no longer necessary for Ad Hoc builds in Xcode 4 - see details notes in Apple Technical Note TN2250
If you once come into the situation, that checking "get-task-allow" seems to be required in order to deploy your debug (!) build to your phone, check this:
a) Check the build setting. There should be no entry in "Code Signing Entitlements" for Debug
b) Remove Entitlements.plist temporarily and build your debug version. If it complains about a missing Entitlements.plist, then you probably have the same situation, I had to fight today.
c) Build again with Entitlements.plist and enable "get-task-allow". If it works now, you probably have the same problem:
After messing around with new profiles I couldn't deploy my Debug build to the phone. AdHoc was fine. I checked a) - empty.. Hmm. I checked b) - complains. c) - worked...
After all I examined project.pbjproj in an editor and - although the GUI did claim, that there was no entry for "Code Signing Entitlements" in fact there was one in the Debug section. I emptied it and was done.
This is because your device, on which you are running your application is not selected with your provisioning profile.
So just go through Certificates, Identifiers & Profiles select your iOS Provisioning Profiles click on edit then select your Device
I have just had an exciting three hours battling with this. I have just upgraded a project to 4.2 and for some reason it just wouldn't work.
I eventually removed the Entitlements.plist file and then created a new one.
File > New File > Code Signing > Entitlement
Name the file Entitlements.plist
Make sure it's in the Resources group in xCode.
It didn't put in the get-task-allow BOOL type in the Entitlements.plist file. I added it, checked it, saved it, unchecked it, saved it. This made me feel better.
I then removed the Adhoc and Release profiles I had created. Re-downloaded them from the Provisioning Portal and droped them back into the xCode organizer.
I then went into Build Settings and made sure the correct profiles were assigned to the Debug and Release profiles.
I then changed the to Release / Device. Hit the build button and it worked.
I have no idea why.
John's answer is 99% correct. I found that (at least in my configuration), you have to open the Build settings inspector for the PROJECT. The build settings for the target do not contain "Code Signing Entitlements". Perhaps this doesn't make a difference if you have only one target in your project. But if you have multiple targets, you need to go to the project build settings. In any case, after doing what John said, my ad-hoc distribution build worked perfectly.
In Xcode 5.1, if you go into Preferences -> Accounts -> View Details...
Make sure the Signing Identity status is Valid. If it says Revoked, hit the Plus button and add the appropriate signing identity: iOS Development or iOS Distribution. Xcode will replace it with a new, valid one.
For me that solved it:
https://coderwall.com/p/-ckobg
Open Project.xcodeproj > project.pbxproj
Remove all lines like these:
PROVISIONING_PROFILE = ...
"PROVISIONING_PROFILE[sdk=iphoneos*]" = ...
CODE_SIGN_IDENTITY = ...
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ...
Set provisioning profiles & code signings for the target again
pJosh, this might help understanding. In my case, my Team Provisioning Profile was expiring (the Provisioning Portal indicated it is managed by XCode), as well as the device testing profile for the app. (I still don't know why, but the portal had a "Renew" button next to the team profile, but it wouldn't do anything when I clicked it.)
So, I deleted the profiles about to expire, then in XCode go to Organizer (Command-Shift-2), under Library / Provisioning Profiles, I deleted the expiring ones. Then click "Refresh" at the bottom, enter my Apple ID, and it renewed the expiring ones.
Finally, on my Target, I went to Build Settings, Code Signing, and made sure to select the provisioning profile. Voila, now it builds to my device.
Just got this same error code.
It seems there are different things that cause this and therefore different ways to fix it.
In my case, I had two different devices with the same name (an iPhone 4 and an iPhone 4S). Changing the name of one of them fixed this error completely for me...
I was trying to add iCloud support to my existing app, but found that after adding entitlements and configuring iCloud, my app would no longer debug.
I realised that my generic iOS development certificate had a different APPID from the app I was working on. So to fix it, instead of using my generic certificate I created a specific development certificate for that APPID.
I refreshed my provisioning profile in XCode, cleaned out the app, disconnected my device, restarted XCOde and connected device and ran, and it now works a treat!
I also spent several hours fighting with this as well. The fix is real simple. Edit your Entitlements.plist file in the root of your project's directory. Find the line that says <key>get-task-allow</key>. Underneath it should be <false/>. Change that to <true/>.
Sorry that this is very late, but I just was looking at this question and found something that worked for me. I went to PROJECT->Build Settings and found the Code Signing section. Beside debug, my distribution profile that said Iphone Distribution: MY NAME was selected. I instead selected Iphone Developer: MY NAME on the drop-down list under IpodProfile (for bundle identifiers com.myName.myApp which was the provisioning Profile for my device. Hope this helps!
I just had this happen to a developer on the team I administer.
It turned out his developer certificate expired and after renewal, I neglected to add his certificate to the provisioning profile his app used.
I had not agreed to the new updated licensed agreement from apple.
Briefly : Please log in to your developer's account -> profile's -> review -> read the agreement or get your lawyer read it for you -> agree (at your own will) -> and again click profile's to check the status of your profile.
In my scenario the valid code signing entity was not showing up. When i followed the above procedure it was visible and i was able to run the app on the device and/or create the iPA file without much difficulty.
Had this issue occur when everything seemed to be setup correctly, build setting were pointing to correct provisioning profile, code signing was properly setup, etc.
Issue occurred because I had just created a new scheme and hadn't regenerated my CocoaPods for the new configurations. As you can see from the image, the new ad-hoc configuration is pointing to the Pods.production configuration, instead of a Pods.ad-hoc configuration (and test respectively)
To fix:
Set the offending configuration to None -- cocoapods wouldn't generate the configs unless I did this
Close XCode
Run pod install
Re-open XCode and set the new scheme's configurations to the newly generated configurations.
That's it!
Check if you're device is included in the provisioning profile.