Code Signing Apple Watch - ios

I wrote an apple watch app for my iOS app. Watch, Watch Extension and iOS app have different bundleID. I wanted to send my app to testers via fabric however I could not archive my app because of code signing issues. I could not solve the problem.
***Watch has conflicting provisioning settings. ***Watch is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor.
Code signing is required for product type 'WatchKit App' in SDK 'watchOS 3.0'
Are there any documents that clearly explains how the code signing works? How should I solve signing problem?

To fix this I went into each of the failing targets and selected the 'General' tab, then untick and reticked 'Automatically manage signing'.
I then reselected the correct Team and everything worked. Hope this helps someone else.

Related

iTunes Connect submission code signing entitlements error Xcode 8

I am having trouble submitting my newest app update with Xcode 8 GM. I updated my iPhone and watchOS app in this update.
When trying to submit I get the following error:
iTunes Store operation failed. Invalid Code Signing Entitlements. Your
application bundle's signature contains code signing entitlements that
are not supported on iOS. Specifically, value 'QX3TDZXXXX.AppName'
for key 'application-identifier' in
'Payload/AppName.app/AppName' is not supported. This value
should be a string starting with your TEAMID, followed by a dot '.',
followed by the bundle identifier.
I set signing to automatic by checking "Automatically manage signing" in Xcode. Everything looks fine to me.
After searching for a solution everywhere I tried to change the Code Signing Identity in Build Settings to iOS Distribution. That also gives me an error right away:
AppName has conflicting provisioning settings. AppName is
automatically signed for development, but a conflicting code signing
identity iPhone Distribution has been manually specified. Set the code
signing identity value to "iPhone Developer" in the build settings
editor, or switch to manual signing in the project editor. Code
signing is required for product type 'Application' in SDK 'iOS 10.0'
I also:
cleaned project
restarted Xcode
rebooted my Mac
revoked my distribution certificate
Did someone else have a similar problem and knows how to fix it?
Thanks in advance!
What helped me was:
I unchecked "Automatically manage signing" and then check it on again.
After that Xcode told me it would reset the settings to the default and after that it finally worked.
I wasted more than a whole day on this but I finally found the solution!
Somehow in my Build Settings, the "Product Bundle Identifier" was only my apps name instead of the unique Bundle Identifier (e.g. com.YX.AppName).
Click on your project, choose your App, press Build Settings and search for "packaging". You should find it there.
Found this by creating a brand new project and comparing every single setting.
In case this is not what is wrong in your project, these are the things I found on this topic before. Maybe one of these things might help you:
project > Alt + Clean (Cleans the whole Build Folder)
restarted xcode (that helped many others!)
revoked all Provisioning Profiles and let Xcode create new ones (Xcode > Preferences > Accounts > View Details > Create next to iOS Distribution)
checked that all App ID names where right
for com.AB.CDE the name has to be "com AB CDE"
restarted PC
checked that Xcode and macOS were the newest version
Try this solution:
Create new "Provisioning profile" & import it.
Restart XCode
Uncheck "Automatically manage signing"
In the drop downlist select new provisioning profile.
Check "Automatically manage signing".
It should help you.
I had the same issue and none of the suggested workarounds here worked. I assumed it had to do something with how the XCode project is configured, so I tracked back and found out I was following this guide Building multiple versions of a React Native app and had missed the following step.
In the project’s info.plist, change the value of Bundle Identifier to
$(PRODUCT_BUNDLE_IDENTIFIER)$(BUNDLE_ID_SUFFIX)
EDIT : Turns out that was not the actual problem. I had to enable Push Notifications in Capabilities since the App ID on the developer console had it turned on.
Had the same issue. I restarted my laptop, rebuilt the release build, restarted Xcode, rebuilt the archives. Then it worked.

No matching provisioning profiles found for WatchKit extension when submitting to App Store

I'm using xcode 6.3
xcode had created a provisioning profile "xxx.xxx.xxx.watchkitextension" automatically, in the code signing of watchkit extension target, I've tried choosing this profile or leaving it Automatic, they all giving me this error "Failed to locate or generate matching signing assets" when I submit it to App Store.
Any ideas? thanks.
This problem looks similar to this question.
Submit WatchKit Provisioning Error
I had the same problem. Here is the solution that worked for me.
Technical Q&A QA1830 The beta-reports-active Entitlement Q: How do I resolve the "beta-reports-active" code signing error? https://developer.apple.com/library/ios/qa/qa1830/_index.html
I had to regenerate the "Distribution" Provisioning Profile that I was using to submit my entire app, before I included the WatchKit extension. Specifically, these steps fixed my problem:
I logged onto developer.apple.com, selected "Certificates, Identifiers & Profiles".
On the Certs IDs & Profiles website > Provisioning Profiles page, click the App Store profile.
Click 'Edit'
Click 'Generate'
Following steps help me out:
1.Make sure "App Groups" in Capabilities page in Container target and Extension target.
2.Goto Xcode > Preferences > Accounts > YOUR_ACCOUNT > View Details ..., CTRL+Click one of the Profiles and open in Finder. Move all Profiles to Trash.
3.Open "App Groups" in Container target and Extension target. Xcode will generate two profiles for you, just like iOSTeam Provisioning Profile: YOURAPPID and iOSTeam Provisioning Profile: YOURAPPID.watchkitextension.
(Make sure your container target and WatchKit App target choose the first one as PP,and your extension target choose the second one).
4.If everything goes well, you can do whatever build, run and submit.
I needed to revoke my certificates (preferences -> accounts). After that XCode offered to recreate them. All fine now. Not sure whether this has unwanted side effects as previous certificates are now invalid.
I had the same error message trying to submit an update to a Watch App that was previously rejected. Since i had previously uploaded, I did not see this error. I used a support incident to get help after exhausting all paths.
I got a response in just 1 or 2 business days -- which at first annoyed me. They said i needed to reset everything to use "team provisioning profiles" and all would be fine. I am an individual developer, so my "team profile" is just mine... but I did walk through all the steps and ta-da, much to my surprise, everything worked and the errors went away. Nothing really to do with any of the application specific or other provisioning profiles i had -- i must have changed a "signing identity" somewhere so Xcode's automatic resolution / fix up did not work.
Apple's message was:
CONVERTING TO TEAM BASED CODE SIGNING
Team-based signing should be used in Xcode 5 and later: it’s the recommended workflow and is what’s covered in App Distribution Guide. Team based code signing requires resetting of all code signing settings in each targets build settings to their defaults. Xcode will no longer use the Code Signing Identity and Provisioning Profile build settings, but instead choose the best combination of signing identities and provisioning profile for the scheme being built.
Technical Q&A QA1814 - Setting up Xcode to automatically manage your provisioning profiles
Which is quite clear and solved all my problems.

Xcode The executable was signed with invalid entitlements [duplicate]

This question already has answers here:
The executable gets signed with invalid entitlements in Xcode
(40 answers)
Closed 2 years ago.
I would install an application in my mobile phone by using Xcode but it was not installed with following an error message.
Error Message
"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)"
Matters of Inquiry
Why does the error message occur while I install the application?
Would you mind if you can give me the solution of this problem?
Check if you are using Entitlement file in Build Setting > Code Signing Section.
If yes, try deleting that file name.
You are using Entitlement file
The entitlements file defines certain capabilities of your app. Usually, the file is automatically generated by Xcode when you enable a capability for your app. You only need the file if you enable certain capabilities, e.g. Healthkit integration. If you'd like to use these features, you have to add it. Otherwise, Apple will reject your app.
To fix this
Go to the build settings of your target.
Make sure that you have "All" selected instead of "Basic"
Type "entitlements" into the search box
The result is the build setting where you can specify where your
entitlements file is located
Remove them
You are using the wrong Provisioning Profile
A provisioning profile is a collection of digital entities that uniquely ties developers and devices to an authorized iPhone Development Team and enables a device to be used for testing. A Development Provisioning Profile must be installed on each device on which you wish to run your application code.
Go to Build Settings > Code Signing > Provisioning Profile
Select a development profile under Team
Please ensure that the Team in the project, target and tests are the same.
Bundle Identifier and App ID do not match
Go to the build settings of your target
Select Packaging and change your App ID to match the Bundle ID
Clear cache in Xcode
Command-Option-Shift-K to clean out the build folder. Even better, quit Xcode and clean out ~/Library/Developer/Xcode/DerivedData manually.
You are using wrong provisioning profile to build your app on devices make sure you are using right type of profile. I was using App Store Deployment profile to build on devices. Use ad-hoc profiles or development profiles to build on your devices.
You are using the wrong Provisioning Profile i.e. Distribution for development. Go to Build Settings > Code Signing > Provisioning Profile and select a development profile.
Check the if your "Code Signing" configurations are same on "PROJECT>Build Settings" and "TARGETS>Build Settings".
Personnally, I use for both:
- "Code Signing identity": iOS Developer
- "Provisioning Profile" : Automatic
Check your "Team" parameter at your targets. It should be the same for your project and tests.
For me none of the above answers worked. I tried to remove every code signing certificate from Keychain and build the app. When I resolved all code signing related errors for my target I still had some of them in Tests target. It has been set by someone else from my team before. I just switched to iOS Developer, and the invalid entitlement error went away.
I was getting this problem after moving app from one account to another. I tried all the solutions given by others, those might be correct in other cases. But I fixed the problem by going File -> Workspace Settings -> Build System and choosing "Legacy Build System". I'm using XCode 10.3.
I faced this problem and my problem was My Bundle Identifier and AppID was not matched. Please change your Bundle Identifier in Build Settings->Packaging like your AppID.
Just goto Apple developer portal from where you have downloaded provisioning profile.
Select your profile click edit and check whether all certificates are selected or not.
In my case selecting all certificates and downloading that new profile solved the above mentioned issue.
Also make sure in your schema you have set "Build configuration" to the correct configuration, in most cases "Debug".
I got this error when export the ipa with App Store provisioning wrongly during CI process. My intention was to export with Adhoc provisioning.
I had the same error. My problem was that I checked 'Enable HealthKit' in Entitlements.plist, but I did not enable HealthKit when I created the App Id.
In short, all entitlements in your app (Entitlements.plist file in your project) should be configured on the provisioning profile you use (Provisioning profile = app ID + certificate + information about devices your app can run on).
Had the same problem that suddenly popped up in my project from one day to the next.
What fixed it for me was turning "Automatically manage signing" off and on again for both targets and making sure the right development team was selected once it was on again (defaults to none in my project).
It could seems a easy solution but I solved updating my iPhone's iOS version.
All answers I have seen talk only about xcode update. It was strange because my old iOS version was iOS 13.3.3 and it worked on another iPhone with iOS 13.6. After updating to iOS 13.7 it worked.

After Provisioning profiles are made, code signing not found

Here are the steps I have taken to get where I am now:
Created two certificates in the developer center for APNs development and production (both tied to the App ID I am using with push notifications enabled)
Downloaded and installed the certificates into Keychain Access.
Created provisioning profiles in developer center for production and development (both pointing to the appropriate App ID)
In XCode, under Preferences > Accounts > View Details - I refresh and get the provisioning profiles. It lists two signing identities (development and distribution but not sure if these are correct).
Under Build Settings I have the appropriate provisioning profile selected but...
There are NO code signing identities available, except "iPhone Developer"
So my question is, how can I get the right code signing identities listed here so I may publish my app? The app currently working fine in the app store, but I want to switch from a Phonegap build (what I currently have published) to an Xcode build.
Any help is GREATLY APPRECIATED! Thanks!
It sounds like you are doing everything correct until you hit step 5. Since provisioning profile are under signing identities, my guess is that since you choose the provisioning profile first it's messing something up.
Try resetting your Provisioning Profile to "None". Then select your Code Signing Identity.
Under Target -> General Are you selecting the correct "Team"? Without the correct team, your code signing will not be found.
Please make sure that the Code Signing Identifier under the Build settings for both the Project and Target MUST be the same.
If still can not work, then I think you can clean up the project, close down your XCode project and then reopen. Sometimes it solves the problem this way.

CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 6.1'

I know this has been asked before.
However, I have ensured that the profile is in BOTH the project and target.
Actually should I set that up in the project or in target?
Update: I can actually install the app on device but if and only if I change the code signing identity to iPhone Developer for debug.
However, I obviously want to launch the application with my distribution profile instead of my developer profile.
I finally got this thing solved.
Basically I deleted all certificate and provisioning profile from itunes connect or apple developer website.
Then I waited 5 minutes. Add 2 distribution provisioning profile. Then do it again.
It works.
Oh ya, I need to ensure that the code signing identity points to the right provisioning profile. That's it.
Make your deployment target less than 6.1. It will work
In my case, I didn't set the Scheme correctly. Newbies can forget this sometimes.
Go to: Product -> Scheme -> Edit Scheme
Select Archive and make sure that the Build Configuration has desired value Debug/Release (as compared to target settings)

Resources