iPhone Entitlements problem with XCode 4 for Ad Hoc distribution - iphone

I have reread all the documentation and postings on Ad Hoc distribution and still have a problem. If I try 'wireless' distribution (with a .plist and .ipa file being downloaded using Safari) the app starts to download, the icon is drawn correctly and the name changes from 'Installing..' but when its about 90% complete I get an 'Unable to Download ...' alert.
If I use the iTunes method of transferring the app I get 'The app "xx" was not installed on the iPhone "xx" because the entitlements are not correct.'
Q1: I have read that you no longer need to separately add the .mobileprovision file because XCode (I am using 4.0.1) adds it to the bundle - is this true ?
Q2: when I 'download' the .mobileprovision in safari (on the iPhone) it merely displays it as text. Is this symptomatic of my problem or an irrelevancy ?
Q3: does this problem concern the Entitlements.plist ? I can't find any documentation from Apple or any blogs that relate to what I see when editing this file with XCode 4.0.1. If I follow the instructions (New->New File->Code Signing->Entitlements) I get a default file with only a 'Can be debugged' Key. I have tried setting this to NO, adding a get-task-allow Key (replacing the existing - presumably Can be debugged is the same key ?) adding my application-identifier, and adding an iPhone Entitlements Dictionary with the above two keys in (as per Apple's documentation).
Q4: what is the suicide rate amongst iPhone developers trying to get Entitlements and Code Signing working?
To cut down on suggestions I've seen for similar questions:
I do have Code Signing Entitlements set to my Entitlements.plist for Distribution and Release.
I have tried restarting XCode, rebuilding, archiving etc
I have tried restarting the iPhone
I have gone back to the iPhone
Update:In XCode 4.0.1 there is a menu option when the Entitlements.plist is being edited (Editor->Show Raw Keys and Values) which will toggle the key from 'Can be debugged' to 'get-task-allow'

The entitlements file should be:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>get-task-allow</key>
<false/>
<key>application-identifier</key>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
</array>
</dict>
</plist>
this works for wireless too.
Why on earth the default one doesn't have all this in is something only Apple can answer.
I can't see how to edit the raw text of a plist in Xcode so edited in TextEdit.

Code signing entitlements are no longer necessary for Ad Hoc builds in Xcode 4 - see details notes in Apple Technical Note TN2250

I just wrote a blog post outlining all the steps to successful ad hoc distributions in Xcode 4 which may be helpful. http://www.musicalgeometry.com/?p=1237

Entitlements.plist should be added in project and there should be only get-task-allow key inside it.
When debugging on device using developer profile, It should be checked
When building using Ad-Hoc or Distribution profile, It should be unchecked
Regarding Q4: If you like you can increase it by just doing... but I don't recommend it.

If you right click on the plist file in the project navigator, and select "Open As" then "Source Code", you can edit it as plain source.

Maybe they made a shorter version of Entitlements.plist in xcode4. The default Entitlements.plist does not contain the 'application-identifier' and the 'keychain-access-groups' keys, but if you change the value of the 'Can be debugged' key via the 'ASCII Property editor' it really changes the value of the 'get-task-allow' key in the background...

I tried setting the entitlements parameter "on" or "off", re-download my ad-hoc provisional that had been used for as long as I can remember, and tried hundreds of other combinations. None worked for me until...I went to the provisional portal and recreate a new provisional.
What really got me to stay up until 4:00AM and wasting hours of time that I did not have was how I created the ad hoc provisional. On Apple's iOS provisional Portal page, if you click on the "provisioning" on the left side bar, you will see 4 tabs: "development", "distribution", and the other two. I used to use my provisional created under the "development" tab and added all the test users' phone UUID. That had worked for me for years until the xCode 4 came along, and I was stupid enough to jump on board too fast. Apple engineers had always given me a surprise "mid-night" party every time xCode had an update. And they will wait long enough for me to forget this experience and release the next one.
The solution that worked for me was to create a provisional under the distribution tab. When you create a new provisional here, you have the option of selecting "ad hoc" as the "Distribution Method." After used this provisional on xCode project and target build setting, and turned off "can be debugged" on the entitlements, I then could install via iTunes or via OTA. I hope this tip might help someone save a few gray hair.

Related

App Store submission shows app icon issues in Xcode 11

I was recently not able to submit the app to Appstore and its showing 3 errors and the thing is i have all the app icons placed in Xcode as you can see in my screenshot correctly but this error comes. I have been trying for many hours to solve this issue. Anyone has idea what is wrong and how to solve? I have included all the icons in my assets folder as you can see . I even checked the dimensions and even deleted assets folders and created new . But still the error comes. How to solve this issues?
Missing App Store Icon. iOS Apps must include a 1024x1024px App Store
Icon in PNG format. Without providing the icon in the Asset Catalog or
via iTunes Connect, apps cannot be submitted for App Review or Beta
App Review
Missing Info.plist value - A value for the Info.plist key
'CFBundleIconName' is missing in the bundle 'com.abcd.iphone'. Apps
built with iOS 11 or later SDK must supply app icons in an asset
catalog and must also provide a value for this Info.plist key. For
more information see
http://help.apple.com/xcode/mac/current/#/dev10510b1f7
XCODE ASSET FOLDER
Added the info.plist screenshot :
Make sure your asset catalog is in fact part of the app target.
Make sure your build settings point to the AppIcon image set.
And make sure you don't have multiple asset catalogs with multiple AppIcon image sets, as the build system will not know which one to use.
You should be able to open the built app package in the Finder and see the CFBundleIcon entry:
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon60x60</string>
</array>
<key>CFBundleIconName</key>
<string>AppIcon</string>
</dict>
</dict>

Invalid Code Signing Entitlements [duplicate]

This question already has answers here:
App Submission Error - Invalid binary - Invalid Code Signing Error
(3 answers)
Closed 5 years ago.
I ve followed all the procedure that app store support placed for help yet when ever i sumit the app after upload the status becomes "invalid binary" with following msg in the mail.
Invalid Code Signing Entitlements - Your application bundle's signature contains ubiquity code signing entitlements that are not supported.
Specifically, value "( 79FWT492R4.* )" for key "com.apple.developer.ubiquity-container-identifiers" in is not supported.
I will be thankful if someone help
Thanks
MGD
Well i really dont know why Apple has set so many complications for the app submission.Now coming towards the solution, What i did was, I used the same APP ID but i reconfigured it by unchecking the iCloud option, then i renewed the provision and distribution profiles downloaded them, deleted the old profiles from the xcode organizer added the new ones (those i downloaded after renew), first my app started giving error during the that "key does not match .... " then i went to the built info of the target there i simply set "iphone distribution" in code signing, Thats it i build the app and uploaded via organizer, and it went with the status "Waiting for Review" :)
Cheers
MGD
Just to clarify the answer, which I found confusing. I had ths problem just now (October 2011) and solved it quickly.
I thought I had to revoke my own distribution certificate, but this clarifying note saved me (can't find the source right now but THANK YOU)
Go to App IDs in the provisioning portal. Scroll to the bottom. Click configure on the row that represents your app’s ID. Uncheck Enable for iCloud. Click Done.
--
Now you can just regenerate your distro provisioning prof (no need to create a new one) and redownload it into Xcode, reubild and resubmit. i hope this helps people
There is indeed no more option to disable iCloud in Provisioning Portal. But apparently Apple has noticed that the iCloud entitlements in distribution certificates may cause trouble during submission and has recently REMOVED these entitlements from the certificates again.
So help is near: Just re-create your distribution certificate and you'll see that it doesn't contain the offending keys any more. Hope that helps.
Under the Code Signing section in my Build Settings, Xcode had selected iOS Developer for Release instead of iOS Distribution. Selecting the correct distribution profile for Release resolved this issue for me.
My solution was to remove the provisioning profile entries. Evidently in addition to the Code Signing entries, now there are also Provisioning Profile entries and mine was stuck on an old version or something. Clearing that fixed the problem.

Getting an error from push notification

In my app, I need push notifications. I am implementing all the instructions from the push notifications docs. But I got an error from Push Notification:
Fail To Register For Remote Notifications With Error:
Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment'
entitlement string found for application" UserInfo=0x2340a0
{NSLocalizedDescription=no valid 'aps-environment' entitlement string
found for application}
What I am doing wrong?
Generate a new provisioning profile, after you enable Push, and it will work!
I am using Xcode 6.1.1
You don't have to delete or recreate anything. You just have to make Xcode update your active certificates (including the new push notification certificate).
Simply go to Xcode > Preferences > Accounts > pick your Account > pick your Team > View Details
There click the refresh button in the lower left corner. (Also check your code signing in build settings)
I had same problem,I solved it making sure in Built Settings, Code Signing Identity for debug is set to proper Provisioning Profile in which you enabled push notifications.
First, you need to make sure you use an app ID without a wildcard.
Then you need to enable that app for push notifications for development.
Check this tutorial, for example.
Even after you've enabled your app id for push, it might take a couple of hours for it to work.
That was making me crazy. I cross-checked everything but still was getting the same error.
Tried all the other solution given on the web as well.
However, this did the trick for me. I create .mobileprovision file before enable APNS. This was the real mistake.
Resolution of this problem :
Create App ID
Enable APNS
Then create Provision File
If you have created provisioning profile earlier and the you have enabled APNS , you should delete provisioning file from everywhere in your system(XCode,keychain,iTuneConnect). And then create provisioning file again.
I just dealt with this issue. While there are probably a lot of things going on, here is what I learned.
When you make changes to an app ID, such as enabling push notifications, you need to create a new provisioning profile. I must have created my app ID, made a provisioning profile using it and then enabled notifications on the app ID.
Once I removed the provisioning profile from the portal, and device, I made a new one using the modified app ID. Downloaded it, tossed it on my device, wham bam thank you ma'am it worked. Hope this helps people in the future!
This just solved it for me so I will share.
If you update your app id you then must delete the profile from your device, xcode, and developer.apple.com. Then create a new matching provisioning profile that is updated with the new app id settings. Its best to name it something slightly different so you know you are selecting the correct one.
First thing you have to run applcaiton in device.
This is will happen in xcode 3.2.6. Because when you are getting everything perfect. But your application is not registering in your iphone, ipad or ipod. You need to generate a Entitlement.plst file.
Step: First select your project in xcode create a file. Select codesign file named it entitlement.plist(default name).
Put it on resource folder.
Right click open as xml editor.
Then open your provisionfile like your_apllicationName.mobileprovision (which you have created for Apns server ) in textedit mode.
Now copy some lines like the following from your provisioning profile into your entitlements file:
<key>application-identifier</key>
<string>xyz.com.company_name.app_name</string>
<key>aps-environment</key>
<string>development</string>
<key>get-task-allow</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>xyx.*</string>
</array>
Save the entitlement.plist file.
Run your applcation you will notify by Apns server.
Make the Profile right.Maybe you do not set the profile.
For me -> go to project settings -> app target -> Capabilities
enable Push Notifications!
Just make sure that you are using the specific provision certificate
go to: https://developer.apple.com/ios/manage/provisioningprofiles/index.action
check the status of your provision certificate, in worst cases just create new one, download it and assigne it to your project again.
Make sure which type of provision you are using, "development" or "distribution"
I got same too. Here is how I solved.
1) Deleted provisioning profiles at ~/Library/MobileDevice/Provisioning Profiles
2) Deleted profiles from Developer Account
3) Created and installed new profiles
Note that regenarating of profiles didn't solve.
ok, a little embarrassing, but sometimes you spend hours on the most idiotic bugs -
so, I run the application on DEBUG mode instead of AD-HOC.
to change that, do:
scheme -> Edit Scheme...
select Run on the left, and change to Ad-Hoc dist under Build Configuration.
*of course you need to have the suitable adhoc provisioning profile under build-setting\code signing as well as the suitable APNS certificate attached to it when you create the provisioning profile.
** once you run it, it'll crush cause its not on DEBUG mode, but you can still run in from the device.
If you're managing more than one apps pushes on one server then consider the following facts.
You need to process a separate private key as a p12 file to prepare pem file and this private key is generated in keychain app when you create a .certSigningRequest file. So, this CSR can be reused for same app upon expiration but a separate is needed for any other app.
I got same error in XCode 4.6.1, It worked for me then I delete the previous APNS profiles from the Mac and redownload the APNS provisioing profile from member center. In Build Settings at target mode, Code Signing Identity should only in Debug Mode as iphone Developer for Release put as nil or delete the developer or distribution.

The entitlements specified...profile. (0xE8008016). Error iOS 4.2

I am getting the 'dreaded' error The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.
(0xE8008016). when trying to deploy my first app to an un-jailbroken device on iOS 4.2.6 (Verizon). The thing is, I do not have a Entitlements file in my project, as I am not distributing it at all, only putting it on one device. I have gone through all the hoops and loops apple puts you through (certificate, device, provisioning) down to the letter, and I cannot figure out what is going wrong.
Can anyone please help me with this problem?
Just came across this issue myself, the problem was that I had a Entitlements.plist file in the project as part of an ad hoc distribution, and its get-task-allow (ie. 'can be debugged') property was set to NO - setting this to YES fixed the issue and allowed the app to run from Xcode4 on the device in development.
Naturally need to set it back to NO for ad hoc distributions, but just thought I'd mention it in case anyone else comes across the same problem.
I had this issue with Xcode 4.2.1.
For me it was nothing to do with Entitlements file, or Ad-hoc...
I was returning to and old project, and I'd forgotten to add my new iPhone to the provision.
Silly mistake, but also a silly corresponding error message... :-/
If you're using react-native, make sure that the Test target has the same provisioning profile as the main one.
I've had this issue with the iCloud entitlements. My problem was that I forgot to enable iCloud for my App ID in the Provisioning Portal.
After enabling iCloud for your App ID, you will need to recreate the provisioning profiles.
Keep your entitlements file in Target> Build Settings > Code Signing > Code Signing Entitlements.
Go to Target > Capabilities.
Toggle On/Off or Off/On one of the capabilities.
Run.
What worked for me was to completely delete the entitlements file, from the groups list, and from the Build Settings in both Project and Target. Then I recreated the entitlements from the Summary tab in the target, and it loaded fine without any error messages.
Just putting in my 5 cents here. For me none of the above worked, so I was forced to stress down and actually look at every part of the process with fresh eyes.
In rushing this I forgot that I was trying to install my app on a totally new device.
So my error was that I hadn't updated my provisioning profile by ticking off my new device int the "Devices" section of the provisioning profile setup in the Provisioning Portal.
Apparently not including your device in the provisioning profile also generates this error message.
None of the many answers fixed the 0xE8008016 Error for me.
But when I chose "Automatic Device Provisioning" in Xcode 4 > Organizer > Devices > Provisioning Profiles, it finally worked.
In my case it was a stupid mistake. I incorrectly set the "Run" scheme to use the "Distribution" build configuration instead of the "Debug" or "Release" one.
Stupid mistake, but it took a while to debug it, so I'm going to add my answer to improve the knowledge base inside stack overflow!
Delete your provisioning profiles, do a 'Clean All', make sure that your provisioning setting are correct, redownload, and try to run again.
Open 'iOS Provisioning Portal' in Safari.
Tap 'Devices' in the sidebar.
Register your device's UDID
Tap 'Provisioning Profiles'
Edit your apps profile.
Select the device your have just added.
Download the .mobileprovision file.
Install it.
Build again.
I had the same problem in my app, after a few month this specific app worked fine.
The problem was that the Capabilities configured in my Xcode project (under Targets -> {ProjectName} -> Capabilities) were not the same as the Capabilities configured in the provisioning profile (you can check that in the Apple member centre under Identifier -> App Ids -> {your app ID}. In the member centre I saw that Game Center is enabled and so in my project I also enabled Game Center. Then the app was able to launch.
I don't know how it worked until now. That's still a mystery :)
For me check the "Automatically manage signing" option in Target solve the problem!
Upgrading to XCode 4 fixed the issue.
Deleting the xcuserdata folder solved my issue. More on that here: https://stackoverflow.com/a/9968884/300694
If you didn't change anything related to certificates (didn't replace or update them) just do a Product -> Clean. It helped me several times. (Xcode 6.2)
I ran into this problem today and I was pulling my hair out trying to figure it out. Like many people here, it would work if I removed the iCloud options in my entitlement file. When I would go to debug the app with the iCloud options enabled then I would get the 0xe8008016 error. This was right after revoking and regenerating new certificates.
So what solved it for me was to turn on iCloud support for the automatically generated Xcode team profile. Log onto the online provisioning tool, go to App IDs, click on Xcode iOS Wildcard App ID, click on edit, enable iCloud by checking the checkbox, and finally clicking Done. Refresh your profiles in Xcode and then it will start to work.
This makes some sense - when you're debugging it defaults to the team profile and the team profile needs to have iCloud turned on.
Happened to me when I was trying to use an app store distribution provisioning profile for local test by mistake. When I used the proper development profile it worked just fine. Maybe this helps somebody too.
This worked for me...
I deleted the Entitlements file from the target.
Deleted the app off all my devices
Cleaned the build in Xcode
*optional delete the provisioning profile and re-add it
Hope it works for you guys too :)
This is what solved my problem: Deleting the path in the Code Signing Entitlements section of the Targets build settings.
My provisioning profile from Apple developer matched my Xcode capabilities but it still wouldn't build onto my device until I did the following:
Remove/Delete the entitlements file from your Xcode project.
Go back to the Xcode capabilities tab
Hit "Fix Issue" button to get Xcode to re-add the entitlements file.
Worked for me, hope it helps someone.
Happened to me on Xcode 8, it was partially caused by the new Provisioning Profile build setting, as in this Xcode version there are two entries for provisioning profile:
Provisioning Profile
Provisioning Profile (Deprecated)
My fault was that I updated only the first one, and the deprecated entry was still pointing to an invalid provisioning profile. Changing both to the same value solved the issue (clearing the deprecated entry should also have the same effect).
In my case, it looks like Xcode (secretly) reset the Scheme.
I found that the build configuration for Archive was set to Release instead of distribution one, and after I changed it to the correct one, it worked.
I think it is better to check the Schemes as well as the build settings.
I had old project and same problem and I solved .
1.Go to summary
2.Summary have keychain groups and delete keychanin
groups's object.
I hope it's will work for you .
Regards.
i'm using xcode 6 and encounter this issue for one particular iphone 4
finally , i go to device => provision profile =>
and then add the profile manually and problem is fixed .
For me in Xcode 5.1 I was getting The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. when trying to test the app on my device. Device Development Certificate has to expire Feb 2015.
Issue was resolved:
Selected Target->Capabilities, under GameCenter, here I was getting error on GameCenter entitlement as it was not added to project, although first version of application was released via same XCode 5.1 but there were no errors like this before.
Below, a button was given with title Fix Issue. When clicked it added the GameCenter entitlement and issue was resolved.
After wards the screen looks like:
For me, there was nothing to do with certificate. App now runs successfully on the device.
One more potential problem that will throw this error message: If you're using a perfectly valid provisioning profile for you main app, but have an expired or otherwise invalid provisioning profile for your Today widget extension. I imagine it'd be the same for an Apple watch extension as well.
Check all the profiles!
Check KeyChain Access!
In my case I was using the wrong distribution certificate associated with the provisioning profile.
The code I was working on had a different bundleid in the Info-plist than in the Product Bundle Identifier build setting.
I found this because I noticed this message in the device console in the devices view:
MIS: entitlement 'application-identifier' has value not permitted by provisioning profile 'iOS Team Provisioning Profile: com.xxx.yyy'
If you are trying to activate iCloud syncing, you will need to enable iCloud for the AppID that is used to create the development provisioning profile (which Xcode does automatically). You'll also need to enable this for distribution profiles as well.
The tricky part is that when you refresh profiles in Xcode, this does not trigger a renewal of the profiles; they are simply re-downloaded. So in your iOS Provisioning Portal under Provisioning/Development, you'll need to check the profile that is labeled (Managed by Xcode) and delete it (Remove Selected button). Do this for ALL profiles, development & distribution, that you need to regenerate.
Now, in Xcode in the Organizer, delete provisioning profiles that you are about to replace.
Now to get new ones. If you develop for more than one team and only want to refresh a particular one, select the appropriate Team in the left pane under TEAMS, otherwise select Provisioning Profiles under LIBRARY, then select Refresh.
Finally, remove any old provisioning profiles on your device that could conflict with the new ones since profiles are never deleted automatically; newer profiles are simply added to the list.

Ad-hoc distribution odyssey - not valid signer

I am totally aware of billions how to and forum discussions out there about this issue. Because I could not find the solution I'm writing here.
Typical situation: I want a co-worker to test my App. I thought on Ad-Hoc distribution. I followed every kind of tutorials. But I receive always a "valid signer" issue in iTunes.
Basically:
1) have a distribution certification which works like a charm to upload apps to iTunes;
2) add UUID number of my friend's iPhone in the portal
3) use the same App ID I used till now for the AppStore xxxxxx.* so that in the Bundle Identifier I can insert, like always for the appstore, com.mydomain.nameoftheapp
4) create a provisioning file, Distribution, where I check my and my friend's iPhone
5) add it to xCode, dragging it to icon in the dock
6) create the Entitlements.plist and uncheck the only field in it
6) create a copy of Release, named Distribution and set it active
7) leave untouched the parameters in the PROJECT
8) in the TARGET, add the Entitlements.plist in Code Signing Entitlements and the provisioning file (which is present and black, not gray) under Any OS Device, leaving blank Code Signing Identity
9) Add an icon, like always, PNG 57x57
Now, I clean all the targets and then I build. Drag both the mobile provisioning file and the .app to iTunes. Rather than to send it to my friend, I try with my iPhone. But the error is always the same. Can't install because of not valid signer...
Can you help me? I can provide you with screenshots and everything it may help...
Thank you so much!
Fabio
I had the same problem, the process described in this post from the Apple developer forums solved it for me:
Remove any versions of the
application from iTunes.
Drag the mobile provision file to iTunes (it seems like nothing happened but continue on)
Sync the iPhone (again nothing should appear any different)
Drag the app to iTunes
Sync the iPhone a second time.
Good luck!