iOS Code Signing Error after App Name Change - ios

Fellow Devs,
I used xCode 4 to develop an app called 'myApp1'. Now I changed the name to myApp2 in the xCode Project Settings, created a new provisioning profile in the Apple prov portal and downloaded it.
However, when I try to compile I get the following error:
Code Sign error: Provisioning profile 'myApp1' specifies the Application Identifier 'com.company.mobile.myApp1' which doesn't match the current setting 'com.company.mobile.myApp2'
Apparently xCode thinks it still needs to use the myApp1 provisioning profile with the new app. How can I point the project to use the new provisioning profile?
Any help greatly appreciated!
thanks!

select your project in the Navigation panel
select your target in the main window
select the Build Settings tab
scroll to the Code Signing section
choose the appropriate provisioning profile for the appropriate build configuration

You can change your application name without getting a new provisioning profile. If you just want to change the name and keep the same bundler ID, use the existing provisioning profile. When the user updates the app this way, their MyApp1 will be replaced with MyApp2.

This question contains the solution to my issue. The question is slightly different though.
Stackoverflow question

Related

Entitlements don't match Provisioning Profile (0xE8008016)

today I finally got my Company-Developer-Account. I'm working on an App, first on my private Account and today I wanted to move the App to the company account. So I created a new Bundle-Identifier on developer.apple.com and changed the Bundle-Identifier also in my Xcode-Project. Furthermore, I've added the Account to Xcode, changed Signing to my new Company Account and let Xcode fix the Provisioning-File-Troubles. (In Xcode I see two Team-Members from one Account, one is Agent, the other User. Maybe it's important that I've choose the Agent-Team-Member. Unfortunately I can't change because then I get the error "change to a unique bundle-id, because the bundle-id is already on the Agent-Team?^^) Running with the Simulator works fine, but when I want to test on my Phone I get the following Error: The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).
If I press the I next to the provisioning file, I see the following Entitlements:
And under Entitlements I've just the Push-Notifications enabled. But this was like this before changing Bundle Identifier
I had this same problem and none of the solutions I found on stack overflow, or github worked for me.
Here's my solution:
Select your project in the Project navigator
Select the "General" tab.
To the left of the "General" tab, select your target to the left; (this should show a dropdown with a list of targets)
Below your current target you should see an item {your project}Tests; select that.
Check the signing properties in the general tab and make sure they are valid.
This was the problem for me. Hope it helps.
Xcode 9 GM.
Error appears if manual signing turned on.
Turn on automatic code signing.
Turn off automatic code signing.
You need to go through all the details where your provisional profile and certificate getting set from the main page.
E.g. In all targets - > Build settings -> Code signing identity and provisinign profile and set your correct profiles every where in the application.
sometimes when you are selecting manual codesigning then it is not reflecting correcly in all places.
Try to uninstall your application from your device and then run your app on Xcode , i think that current app that was on your device signed with old account so you cannot run your new app that was assigned with new account , hope to help .
For me, I ended up getting this error when I did not have the private key associated with the certificate that was being used to sign the app. Make sure you open Keychain Access and verify that you have a private key for the certificate that is associated with your provisioning profile.

IOS: Code signing error Xcode 6.3.1 [duplicate]

I've build a new application which is going to support IOS 7. I got the new XCode 5 GM and tried to sign my apps using my fresh provisioning profile and distribution certificate, but i'm having trouble with distribution. I constantly get the following error:
"Invalid Code Signing Entitlements. The entitlements in your app
bundle signature do not match the ones that are contained in the
provisioning profile. According to the provisioning profile, the
bundle contains a key value that is not allowed:
'[XXXX.com.sample.company ]' for the key 'keychain-access-groups".
Also the same error for a key value called application-identifier.
Screenshot of the errror:
The solution lies in the new option in Xcode 5 which says provisioning profile. Just set the project target's provisioning profile to the right one and it'll work.
If you are like me and you think you tried EVERYTHING, archived your project over ten times, banged your head on the keyboard and still get this error. Please do yourself a favor and simply Restart XCode, it worked for me. Sometime Apple... I hate you.
I went through many of the steps above but what finally worked for me was refreshing my profiles in Xcode. Not sure why it was necessary since my app's distribution profile was showing up in the list already. Here are the steps:
Xcode Preferences
Accounts tab
Select your Apple ID
Hit the View Details button in the Apple ID detail panel
Hit the Refresh button in the lower left corner
In my case, i activated the same capabilities in Xcode that in Application services in developer.apple.com. Thats works for me
In my case (sorry) I switched "Team" to "None" in -> General -> Identity
In another case I needed to switch this identity from "None" to the developer account managing the identities and profiles.
Xcode sometimes messes up greatly with code signing, it seems. Or, we mere mortals simply aren't clever enough to understand what it is doing, of course. Don't give up, we're all going through some code signing torture at times!
In my case, I had to set correct Provision Profile for Release, and then had to restart Xcode. Before restarting, it had same provision profile, and didn't work. So, sometimes a restart can do miracles. Maybe this helps somebody.
If someone uses a GameCenter then check this section in your target. I worked with some old project and there were 2 errors (but everything worked fine). Disabling and enabling it back solved this problem.
Most likely this action adds Game Center entitlement to App ID and and handle it itself.
1.Go to project folder, delete *.entitlements files.
2.Then go yo in xcode project target -> build settings -> code signing entitlements - delete values
3.Clean
4.Run
Ah, this glorious error. For me whenever I see this error I check the following things:
1. Allow XCode to access your provisioning profile info all the time - If XCode keeps asking when you start it up to have access to your computer's private files so that it can get provisioning profile information with the options to allow access always, not now, or just one time - set it to ALWAYS ALLOW access
2. If you have any old entitlement files kicking around your project get rid of them and any sign of them - if you see a .entitlements file in your project delete it (or at least remove the reference to it if you aren't sure you are ready to outright delete it), then make sure the 'Code Signing Entitlements' line under the 'Code Signing' section in Build Settings is empty
3. Check your Application Services online and match them up with your Services in XCode for the app - Go to the Apple Member Center and check the App ID for your app, click on the app to see its 'Application Services' and see what you have checked, then go to XCode and check your 'Capabilities' section to make sure the two have the same list of Apple services on both
4. Make sure you assign a valid Provisioning Profile to your app before validating - double check your provisioning profile for your app in the Apple Member Center, make sure it isn't expired, has the right App ID with the correct bundle id and distribution. Download and click on the new provisioning profile to make sure XCode has it, or go to XCode > Preferences > Accounts > click on your account and 'View Details' then click the bottom corner button to Sync all the profiles to XCode. You should have the profile available to select now in the 'Code Signing' section. Once you have the correct provisioning profile then you can set the 'Code Signing Identity' lines to the correct option for that provisioning profile.
Note - if doing a distribution certificate it can help to set all the 'Code Signing Identity' lines to the identity you use for distribution including the debug lines
5. IF ALL ELSE FAILS - Clean your project and Restart XCode and some Apple magic may just work fine the next time you open your project and try to Validate
If you're building an old 3.1.5 project, Xcode 5 has some bugs which unfortunately makes Benjamin's answer impossible, as there are no Provisioning profiles to pick from. After many a late hour of tormented reading of Xcode project files I came up with this solution that worked for me:
In the Utilities pane (to the right) in Xcode 5, under project Document, change from Xcode 3.1-compatible to Xcode 3.2 compatible.
Enter your organization name.
Close project.
Open your project file, e.g. open -a TextEdit path/to/name.xcodeproj/project.pbxproj
Remove the two Distribution clauses (isa=XCBuildConfiguration).
Remove the two accompanying lines in buildConfiguration (one in PBXNativeTarget and one in PBXProject XCConfigurationLists)
Now you're ready to re-open, archive and submit to App store - voilà! It works again!
How I think it works
I assume this works because Apple somewhere along the line decided to drop the need for any separate distribution config, which is a good thing. When I archive, Xcode automatically code signs for distribution. That's the way it should have been implemented in the first place, it's just a shame that Apple can't make auto-migration part of the IDE; instead they force us developers to spend man-decades to make this stuff work.
I have been struggling with this problem for more than a day now, trying all kinds of solutions suggested here and elsewhere on the internet. Nothing worked...
But, I finally managed to solve the problem!
The problem I had was with an old app that I haven't touched in over 3 years, and now I was about to release a long awaited update. Since the time I released the app, Apple has been updating how the certificates and App Id works. They have introduced the concept of Team Id which seems to be recommended to use.
In particular, the Apple's "Certificates, Identifiers & Profiles" site, has seen a lot of changes since then.
There I realized that the Provisioning Profile I was using for App Store Distribution were connected to the App Id ED8xxxxxxx.com.rostsolutions.* but looking at the App Id for the game I was about to submit I notice that the App Id was ATMxxxxxxx.com.rostsolutions.Swisch. So the App Id prefix did not match!
That seemed to be the root of the problem. So what I did was to create a new Provisioning Profile connected to the App Id ATMxxxxxxx.com.rostsolutions.Swisch instead. Using that Provisioning Profile I successfully submitted my app to App Store and now I just keep my fingers crossed that everything else works fine at Apple's side.
(I first tried to connect to new Provisioning profile to the wildcard Id ATMxxxxxxx.com.rostsolutions.* instead, but that didn't seem to work).
But what puzzles me is that when I look at the old App in iTunes Connects and goes to Binary Details, it says that the App Id is ED8xxxxxxx.com.rostsolutions.Swisch. So why is the "Certificates, Identifiers & Profiles" page listing the App Id as ATMxxxxxxx.com.rostsolutions.Swisch?
My problem was solved by removing my Apple ID from Preferences->Accounts and then adding it back again. Then all my provisioning profile files showed up on the View Details utility panel. I was mistakenly choosing "Mac Team Provisioning Profile:*" instead of the actual distribution provisioning profile for the project thinking that it was a generic selection. Provisioning files must be specific to the project. Oh, and BTW, make sure your provisioning profile has the correct entitlements (for example, Maps). I managed to release an app with OSX Maps without the entitlement and Apple approved it -- but no Maps showed up on the production version!
In my case, I had the same problem, my solution was to change the 'Release Provisioning Profile' in the Build Settings before doing Archive. I do this twice, once for App Store distribution, and another one for Ad Hoc distribution. I also add a comment on my archives. My conclusion is that there is something broken about the "archive re-signature".
There is a very good tutorial for solving that problem on this website.
It says that this problem can occur when your Projects Bundle Identifier is different to the one you entered on the iTunes Connect Website.
I think xcode 5 uses "release" instead of "distribution" that you may created yourself.
If all above didn't work (in my case after couple of days no luck trying everything) I have only one Mac application. BE CAREFULL WITH REVOKE!
1) Revoke by hand all "Mac App Distribution" & "Mac Installer Distribution"
2) Clean relevant certificates and open-keys in Keychain (Warning: export before delete)
3) Restart Xcode
4) Go to (in Safari) developer.apple.com -> certificates etc.
5) Create CertificateSigningRequest.certSigningRequest in Keychain->Certificate assistant
6) Create by hand on developer.apple.com both "Mac App Distribution" & "Mac Installer Distribution" with your *.certSigningRequest
7) Provisioning Profiles -> Distribution -> create/fix custom provision for AppStore (I'm specially named it as "Mac provision profile for AppStore"
8) Xcode -> Settings -> Account -> Your account -> Refresh
9) Xcode Clean -> Archive -> Validate
I have been struggling with similar problem (I was building for Ad-Hoc distribution). Only thing that has changed since last successful deploy, was adding two devices to provisioning profile.
After double- and triple- checking all build settings, I regenerated provisioning profile (without changing anything), re-downloaded and it worked fine.
So note to self: if there is no logic explanation, you can always try good old IT voodoo.
I also recommend iPhone Configuration Utility, which despite its name, is useful for checking what provisioning profiles you have on computer.
ERROR ITMS-9000: “This bundle is invalid. New apps and app updates submitted to the App Store must be built with public (GM) versions of XCode 5.1.1 or higher and iOS 7 SDK. Do not submit apps built with beta software.
If multiple developers are using the same member center account. One of them can't use a certificate created by others cause they used a certificate request created using their computers.
You need to use a certificate created by you (certificate request
created using your computer).
Alternative, told them to send you the Developer Profile. not sure of the name. to use a certificate created on another computer.
Code signing Entitlements occur because of your resource does not contain Entitlements file in resources,Just go to build setting and search code signing Entitlements delete entry for debug and release, build project again you will see there is no error. Cheers
I had the same problem, but nothing written here worked for me. However, I found a simple way that worked for me. Here's how to do it:
1) In your Project and your Target(s) build settings, choose "None" for all Provisioning profiles, and choose "Don't Code Sign" for all Code Signing Identities.
2) Now, choose your Target and go to build settings. In Code Signing Identity Release setting, choose "iOS Distribution" for "Any iOS SDK". And then, in Provisioning Profile Release setting, choose your distribution profile for "Any iOS SDK". After that your Code Signing Identity Release setting should automatically change to "iPhone Distribution".
3) Archive your build and validate. Now it should work fine. That's it!

How to test Cordova/ionic app on iOS device?

I'm building an app which now runs fine in the iOS emulator, so I now want to test the app on an iOS device. I registered with the Apple Developer Program and ran ionic run ios, which ended with the following message:
Code Sign error: No provisioning profiles found: No non–expired provisioning profiles were found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.2'
So I opened XCode and went to Preferences > Accounts and added my Apple ID. I then clicked View Details... and then the refresh icon so it fetched two Signing Identities. The box below which should display the Provisioning Profiles is empty though:
I then read this article on the Apple Developer site which explains that I need to:
Set a bundle ID
Assign my app to a team
Create the Team Provisioning Profile
The bundle ID should supposedly be set in XCode. Because I am under the assumption that the bundle ID is set in my ionic config.xml file I'm unsure of how to proceed though.
Does anybody know how I can (preferably very easily) test my app on iOS devices? All tips are welcome!
What I did was to create a new project into Xcode, as soon it is created is showing the General tab, under Identity is showing a message saying that can not find the proper certified, something like that, and there is a button "Fix..."
just click it, the passport is requested and you are done.
I just try again and works. Xcode fixed my provisioning profiles sync for me.
Try this
Select Preferences from Xcode
Go to accounts and select agent name
Select view details to check status of your profiles
Select any profile and click refresh on corner below to update profiles.
This should update your profile with expiration dates
Go to project General and downgrade to 8.1.

Provisioning profile for Today Widget extension

I am trying to archieve my app for submission however I am running into issues with code signing.
Basically I have a Today Widget extension for my app. I am unsure about what I should be setting the provisioning profile as. I assumed that I would just use the same profile that I have used for my app, however I get this error:
The provisioning profile specified in your build settings (“AppName”) has an AppID of “BundleID” which does not match your bundle identifier “BundleID2”. Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.
I can of course click 'Fix Issue', but does this actually solve the problem? It just changes my distribution settings to 'iOS Developer' and providing profile to 'Automatic'.
I was struggling with the same problem, and resolved it this way:
You need one App ID configured to the provisioning portal (I assume you have your com.apple.yourappname there)
You need to then configure the second App ID for the Today Widget (which should be com.apple.yourappname.something, where something is the name for your widget, like Today)
Then you need to create two App Store Distribution provisioning profiles:
One for the main App
Second one for the widget
Then assign the correct provisioning profiles for each target to the project settings and set to build for Distribution.
My problem was because of i added "arm" in the Excluded architecture section. I revert it and the problem goes away. It is weird.
Try to create a new App Id for your App extension in Certificates, Identifiers & Profiles (https://developer.apple.com/account). Then create a Provisioing profile for the newly created App id.
If the bundle id for your App is com.apple.appname you create an app extensions with the bundle id com.apple.appname.appextensionname. The same id is then used in Xcode for the widget.

Code Signing not showing Provisioning Profile - Xcode 5.1.

Hi, I recently upgraded to Xcode 5.1 now I can not find Provisioning Profile in Projects->Target->Code Signing section of settings. Before Xcode 5.1, I used to change Provisioning Profile to desired profile from Provisioning Profile option then it starts to appear in code signing identity debug or release section as shown in image below.
But now I am not given this options in Code Signing so I can't change the debug or release profile it only show automatic or identities in keychain.
How an I change to the desired provisioning profile?
Update:
I tried using the 000000B-0000-0000-0000-000000000000 UUID code at User Defined Provisioning Profile and it accepts and build and displays Provisioning profile at Code Signing. But it is not resolving Provisioning profile name at User Defined Profiles.
I was stuck with same issue and finally got it done here u can look for the following screen shots..
go to Code signing in the build setting and change the Provisional Profile NONE to the provisional profile you like to test
then change the Code signing identity to test your Application on device with the suitable bundle identifier look for the following screen shot
If you find this Answer is correct then Vote up lets other also can solve their problem.
Thanks
Make sure you have 'all' and not 'basic' display mode selected.
I filed a bug on this. You can manually do it but a pain in the rear. This to me is a huge bug. I hope they fix it soon.
Login in Apple Dev website and go to the profile list view, then download the profile and double click to install, then you can see it in Code Signing list.
Check your bundle Id and make sure that you have installed your required profile.
Then Click on Provisioning profile option and select a profile(see the option below code signing identity).
Now you need to select certificate under code signing identity.
To be sure:
Our team encountered an afternoon of frustration trying to open an app or update an app compiled with Xcode 5.1 on iOS 7.1 device with a tardy profile. Download and install a new profile (as necessary) then:
Make sure the BUNDLE IDENTIFIER in Xcodeʻs GENERAL view for your project matches what the profile reads on your Dev web portal, and then THAT profile is installed in Xcode verbatim. Select that profile in your BUILD setting, and you could be solved by now (the App installed on devices without issue), but we also noticed we could to go back to GENERAL view and the FIX button actually worked: it fixed the "not found" profile
Try by creating an archive. I attached an iphone and tried to create an archive which result in no provisioning profile error. But now the option in the target to select a provisioning profile was there from which I was able to choose the provisioning profile
Had this problem, just had to open Preferences and refreshed the screen under Accounts - View Details.
The provisioning profile had no options for me. I had registered for the Apple Developers program recently. I followed these steps and then clean and build. It worked.
Import User to XCODE

Resources