Invalid provisioning profile when submitting WatchKit extension? - ios

I am trying to submit our app with a WatchKit extension now that Apple is allowing 3rd party developers to do so. However everytime we try to submit through Application Loader we are greeted with the following error message:
Invalid provisioning profile. The provisioning profile included in the bundle bundleidentifier.watchkitapp is invalid. [Missing code-signing certificate.] For more information, visit the developer portal.
We have set up the provisioning profile just like we have done before without any problems. We have App ID's for bundleidntifier (Companion app), bundleidntifier.watchkitextension (WatchKit extension) and bundleidntifier. bundleidentifier.watchkitapp (WatchKit app) with corresponding distribution provision profiles.
We think the problem lies in the WatchKit app target. In Xcode there is no Build Settings tab when the WatchKit app target is selected thus we cannot assign the provision profile we created.
We have also tried using a WildCard ID and Provision profile with the same error being generated. Where are we going wrong?

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.Maybe you need to regenerate your "Distribution Profile" in Developer Member Center.
5.If everything goes well, you can do whatever build, run and submit.

We managed to fix it by setting the code signing settings at the project level instead of the target level.

Related

renaming xcode project generates signing error

(new to xcode. need to change working project) I want to rename my xcode project, followed the instructions in https://help.apple.com/xcode/mac/11.4/#/dev3db3afe4f
but if I change the Identity|BundleIdentifier, The Signing section warns that "The provisioning profile does not match the ... bundle ID"
Where do I add new BundleIdentifier and how do I use it?
(my xcode version is 10.1)
From If the provisioning profile App ID doesn't match the bundle ID:
If there is a conflict between the App ID in the provisioning profile
and the bundle ID in your project, you receive error messages similar
to the following:
Code Sign error: Provisioning profile 'MyApp Profile' specifies the
Application Identifier 'com.mycompany.MyApp.*' which doesn't match the
current setting 'com.mycompany.MyApp' In the project editor, choose
the target and click General.
In the Identity section, set the bundle ID to match the App ID.
In the Signing section, verify that the team, provisioning profile,
and signing certificate settings are correct.
Next to the provisioning profile, click the information icon.
In the dialog that appears, verify that the provisioning profile
contains the correct App ID.
In addition, you can view the App ID and provisioning profile details
in your developer account.
The Xcode default is to generate a profile per app (ie. com.mypackage.myapp)
You can generate provisioning profiles for a package (ie com.mypackage.*), but this may require a paid developer account and may also require selecting it in the app settings.

Xcode 7: "No matching provisioning profiles found"

I've changed the App ID and created a new provisioning profile for it. The new bundle ID and provisioning profile seem to be correctly set in the target's settings, and I get no warning when archiving it. But when I want to export the archive, Xcode shows me a dialog saying:
No matching provisioning profiles found for "Applications/MyApp.app"
And below it says that:
None of the valid provisioning profiles allowed the specified entitlements: application-identifier, beta-reports-active, keychain-access-groups
What I'm missing to check/change?
Thanks
EDIT: In the warning dialog I'm also shown the buttons "Visit Member Center" and "Import Developer Profile". Do I need to set a developer profile if I just want to export a distribution binary?
Go to Member Center and then "Certificates, identifier and profiles" then create a new developer profile. Download and double click on profile then clean you app. and run.
if not solve. see this video https://www.youtube.com/watch?v=wAdV16nRLp8
What resolved the issue was manually setting Provisioning Profile for Debug and Release to the appropriate values, as opposed to choosing Automatic (i.e., set values to your development and distribution provisioning profiles). Based on this SO answer.
This worked for me in Xcode 7.2:
Select your target, then the "General" tab. In the "Identity" section there was a warning that no provisioning profiles were found, and a button that said "Fix issue." I pressed it, and it fixed the issue.
In my case I was missing the automatically generated provisioning profiles because I had changed the bundle ID in an existing project.
I solved this by creating a provisioning profile with an explicit app Bundle ID rather than a Wildcard one.
For Xcode 8 ( As I tried it on 8 and it worked)
First of all clean the project
Xcode-->Product-->Clean
Select simulator as Generic IOS Device
Then again click on product --> Archive
After the archive is made xcode automatically takes you to orgaiser or else you can click on windows--> organiser.
here you can see all the archive you have made in past.
Now, the main part:
Select an archive you want to export.
Click on export. Its on right side under the "upload to store Button"
When You click it ask to select 1 out of 4 options, select--> Save for Development Deployment (4th option)
After This it fetch the account, Make sure you select the account by which you have made provisional profile or signing certificate.
Thats it, it will start preparing your IPA.
It ask to export your IPA to the preferred location & makes a folder their.
In my case it helped.
No other 3 option gave me same error about provisioning profile but not the 4th one.
If it is not userful by regenerating your Provisioning profile ,you can try to go to TARGETS/Build Settings/Packing/Product Bundle identifier,Maybe you forget change the bundle identifier.

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.

Watchkit Extension - No matching provisioning profiles found

I have created an iPhone app that also includes a WatchKit extension, I can run this fine in the simulator but when trying to deploy to an iPhone I get a provisioning issue for the WatchKit Extention target:
"The provisioning profile specified in your build settings (“XXXX”) has an AppID of “XXXX” which does not match your bundle identifier “XXXX.watchkitextension”. Xcode can resolve this issue by downloading a new provisioning profile from the Member Center."
Xcode automatically created the WatchKit targets with the suffix .watchkitextension and .watchkitapp but this seems to cause the issues when using a provisioning profile and deploying to an iPhone.
If I remove the watchkit targets it runs fine, but this is obviously not a solution.
Thanks for your help
You need to create two new AppIDs in the Developer Portal with the correct bundle identifier for your Watchkit app and Watchkit extension. The bundle identifier has to extend the main apps identifier, so if your app is com.myapp it should be com.myapp.watchkitextension and com.myapp.watchkitapp
You also need to create the related Provisioning Profiles for the AppIDs, one for the extension and one for the app.
Add required add ons (like Keychain) if you are using them in your Watch app.
All in all you will need six PPs, 3 for development, 3 for archiving/store. With Xcode 6.3 team provisioning for development stopped working (for me)
Next goto Xcode > Preferences > Accounts > YOUR_ACCOUNT > View Details ..., CTRL+Click one of the Profiles and open in Finder. Move all Profiles to Trash, then refresh the Profiles.
In your targets make sure you have the correct Team set for your main App target, the Watchkit extension target and the Watchkit App target, also make sure you have the right Provisioning Profiles assigned to main App target and the Watchkit extension target (Watchkit app Provisioning Profile can not be set but will be assigned automatically Edit: With Xcode 6.3 it can has to be set).
To be sure all is fine clean build folder: In Xcode hold command and do Product > Clean build folders ...
Now you are ready to archive.
Im my case I've clean all my provisioning profile as suggested by other users, then I had to delete "code signing entitlements" from "Build Settings" in both App parent and extention target and after rebuild and archive, all work fine.
I made 3 App IDs (for container app, watchkit extension, and watchkit app) belong with 3 provisioning profiles. (I was going to use AppGroup, so my app cannot share single App ID.)
Setting 2 provisioning profiles for container app and watchkit extension, the archive of the my app could not pass the Xcode's validation process.
In my case, the critical point is to set the provisioning profile of the WATCHKIT APP. Setting it, it pass the validation process, and succeed to submit the app.
My procedure of the setting is the following:
In Xcode, open "TARGET" of WatchKit App.
Select the "Build Settings" tab.
In the next line of the tab, choose "All" not "Basic."
The you can find "Provisioning Profile" line in "Code Signing" section.
Set the appropriate provisioning profile of yours.
For a while, I have believed 3rd party app developer cannot set provisioning profiles of WatchKit Apps in Xcode.
Noticing that we can set it, the answer is now clear...
I followed the Technical Q&A QA1814 and that solved it all for me. Basically you set everything to Automatic and iOS Developer. Very important to set the Team: None first, do the changes and then change back to your Team, then restart Xcode.
My situation was that I already had the provisioning profiles and certificates set up for a "normal" iOS app. I had successfully published apps with that. Now I needed to get it to work after I added a new WatchKit target to my existing app. I got many error like "No matching provisioning profiles" etc. After many hours of trouble I followed the routes in the QA1814 article and voila! - Xcode solved everything for me. Didn't need to change/resolve/update anything in Member Center etc.
Also important to use the Bundle ID's correctly. The WatchKit app and WatchKit Extension must use the same bundle ID prefix as the iOS App target.
If the iOS app has bundle ID: [Bundle ID], the WatchKit targets needs to be:
WatchKit App: [Bundle ID].watchkit
WatchKit Extension: [Bundle ID].watchkit.extension
usually when you get that error its because your bundle id doesn't match the app id that is on the provision.
In the case of the watch extension, you need to add the application service App Group to your app id identifier that is associated with your provision, on the developer.apple.com portal if you are sharing data or files between the extension and your app
https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/DesigningaWatchKitApp.html
In my case problem was different than others. I try everything but didn't solve my problem.
Let me explain my situation before explain how I solve it.
First it starts with adding Today Extension to my project. I created different bundle ID for my App Extension. For example if my application's bundle ID com.company.appname, I created for my Extension something like this "com.company.appname.TodayExtension". I'm using XCode Version 6.3.2 (6D2105), and XCode automatically (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...Of course I click the 'Fix Issue' button) create an provision profile for Today Extension.
And just after that I added "app group" to my application and go on coding for a while. But when I try to send my application to the AppStore (Product/Archive/Submit to AppStore), I get this error that says "None of the valid provisioning profiles allowed the specified entitlements: beta-reports-active, com.apple.security.application-groups".
You must know that "app group" could be the key point for you too...
Please go to member center/Certificates, Identifiers & Profiles/Provisioning Profiles/Distribution section. Find your application's Distribution profile and select it. As you can see that status for your profile is "Invalid (like in my case). Then here's the solution, click Edit button, after that Generate button. Now please repeat this action for all "Invalid" profiles. After all your profiles are re validated, now you can go back to your XCode project and update local provisions in your Mac. Go to : Xcode > Preferences > Accounts > YOUR_ACCOUNT > View Details ..., CTRL+Click one of the Profiles and open in Finder. Move all Profiles to Trash, then refresh the Profiles".
Now Product/Clean and (hopefully for the last time) Product/Archive and Submit to AppStore.
Generally speaking, it's happen because you add app group to your application, but you didn't validate all of your profiles after that.
Maybe this will helps someone.
When you are in the Xcode update Your certificate and compile Your program again, real machine commissioning will be "Your build Settings specify a provisioning profile have the UUID 'XXX', clear, no to provisioning profile was found. The Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.".
Close the project, find project file XXXX. Xcodeproj, right-click on the file, select "Show Package Contents" (Show Package Contents).Will open a new Finder.
Find the project in the newly opened Finder. Pbxproj, and open, find the UUID you all contain an error 'XXX' line, delete.
Save, restart the project, then build, with respect to OK.

Xcode6:Embedded binary is not signed with the same certificate as the parent app

After I add Today App Extension Target,I become impossible to compile project.
below is error:
error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.
Embedded Binary Signing Certificate: iPhone Developer: (Developer name) (number)
Parent App Signing Certificate: iPhone Developer: (Developer name) (number)
but Embedded binary certificate and parent app's cerificate are the same.
So I'm confusing now...
I had to select my app under 'Targets', then go to the 'Capabilities' tab and click 'Fix Issues' under the 'App Groups' section
I had discrepancies under Code Signing. My Extension and Main app had different certificates selected. Once I set both to use distribution it worked fine.
In the case of using WatchKit, make sure that your Watch App has the correct "Team" selected in the Watch App Target settings (under General > Signing > Team). I had set the phone app's team, but not the watch app's team.
If your Xcode has been working fine but stopped working after you add an extension target to your project, most of the time is that your app was signed using a older certificate (still valid with your name etc.), while your extension is signed with a newer certificate with entitlement for the extension. This is why the error. In this case, you most likely have two certificates with the same name, and this what you can do:
1.Go to Xcode->Preference;
2. Select Accounts Tab;
3. Select your Apple ID then click on View Details;
4. Under signing Identities List Window, select IOS Development, then click on the
little Configuration icon, and select Revoke;
5. Xcode will then try to download a new certificate.
You can do a clean build after this so both your app and extension will be signed using the new certificate.
I solved it by deleting my Apple ID account in
Preferences -> Accounts
and then logging back in again with my Apple ID
I had the same issue in Xcode 6, but in my case it occured because of having two active developer certificates. Revoking one had fixed the issue.
This issue might arise in the case where the embedded app targets like extensions or watchapp does not have the matching team selected in the General section, as the main iOS app.
Selecting the right team for all relevant targets fixed the issue for me.
I had a similar issue. For me the issue was with the certificate showing, 'signed by unknown authority'. I had followed the below steps and it is resolved.
The problem was missing apple WWDR intermediate certificate.
We must also install the WWDR intermediate certificate issued by Apple’s worldwide developer relations. It can be downloaded from the portal or directly at http://developer.apple.com/certificationauthority/AppleWWDRCA.cer Make sure you add this to your keychain as well.
To add the certificate: open your keychain utility software on your Mac computer, then go to File→Import items, then select AppleWWDRCA.cer.
There are quite a few reasons the issue may emanate from. If none of the other answers are working for you - would like to add another plausible check that helped me. Ensure the certificate you are signing with doesn't have 'Always Trust' (you will see a green '+' sign if the setting is such).
Go to Key Chain access, double click on the certificate you are using.
Expand the 'Trust' drop down and change/set to 'Use System Defaults' from 'Always Trust'.
It's especially true if you are using Swift in your project as the 'Always Trust' setting breaks pertinent Swift libraries.
I tried to run project in iPhone5,but App Extension does'nt support 32-bit architecture.So When I build project in iPhone5S,I can build the project !
You need to create Provisioning Profile for that target and make sure to include the same certificate in it.
Targets has their own bundle id se you will need to create an AppId also.
This solved the same problem that you are having
best
Just let Xcode handle the provisioning work. This solved the same issue in my case. http://aplus.rs/2014/embedded-binary-is-not-signed-with-the-same-certificate-as-the-parent-app/
In case this helps anyone, my fix was that I had updated my archive scheme for release when submitting to the store, but never changed it back to adhoc for testing. Editing my archive scheme to use ad hoc worked.
When I had this issue I went to the Apple Member Center and realized that the Provisioning Profile (for the extension) that I had created was marked as 'Invalid'. I just re-created the Provisioning Profile with the same certificate that the app is signed with and then downloaded it via Xcode > Preferences > Account > refresh.
Once I had the new provisioning profiles I selected them in the build settings. I selected the provisioning profile that was just created and also selected the corresponding certificate in the Code signing entity in the build settings and that fixed the issue.
Note that the extension has its own app id and hence its own provisioning profile.
For Xcode 8 beta 3
My build numbers were off on my different Targets in my Xcode project file.
My iOS target had a build version 3, but my watch app target and my share extension target both had build version 1.
All I did was match all the targets' build numbers (changed them all to 3) and it fixed the issue.
Hope this helps.
Refreshing my provisioning profiles fixed it for me (Preferences -> Accounts -> Double tap the account -> tap refresh button in lower left)
Open your key chain and It's the Apple Worldwide Developer Relations Certification Authority, if I choose always trust, Xcode archives failed. When I changed to system defaults, Xcode archives successfully. Yes you will enjoy!!
For some reason, my developer certificate was stored in my keychain twice. Deleting one of them fixed the issue.
I had got the same issue.
So I did a provisioning profil for each bundle ID and configuration of the WatchKit App :
Watch App Development
Watch Extension Development
Watch App Production
Watch Extension Prod
/!\ Be careful because the app ID of the watch app in the developer portal is something like :
com.example.projectname.watchkitapp.watchkitextension
and when i created the watchkit app the bundle ID in Xcode was :
com.example.projectname.watchkitapp
maybe it something which changed since WatchOS 2.0.
I had to go to:
Xcode-> preferences -> Accounts -> View Details -> select all Provisioning Profiles -> press DEL-key on keyboard after deletion is completed press Download All button!
I had the same issue with an app in Xcode 7.1. The app had a Watch extension and therefore an App Group. What worked for me was to:
Go to ~/Library/MobileDevice/Provisioning Profiles
Delete all provisioning profiles listed there
Go to the iOS Dev Center in Safari and regenerate all provisioning profiles
Go back to Xcode => Preferences => Apple IDs and choose the Apple ID associated with the app
Click "View Details..." (lower right)
Download the provisioning profiles that were just created
Clean and build again
I believe my provisioning profiles got mixed up because I was using Xcode's "fix automatically" feature for another issue I had with Capabilities => Associated Domains.
Open KeyChain Access on your mac, delete the other one certificate that is diff from your own certificate.This issue was general appeared after you loged in another account in your Xcode.
I faced the same issue too, I solved it by the procedure as follows:
First, I re Create my team develop certificate(Because we renewed our root certificate)
2、 edit the Iphone Apps develop certificate ,be sure include your certificate you just create.
3、doing same to the watchkit extension And watch kit App
4、go to Your Xocde "Preference ", double click your "Team Name",delete the old Certificate of Iphone 、watchApps、 watchExtention
5、download your new certificate and install.
Then it works.
In my case my App and my Widget profile were signed with different certificate.
So I had to go to to iOS Developer site, select parent app provisioning profile->Edit and choose the same certificate as the widget.
Then click "generate" and "download". Onece you have download it, double click on it to install in XCode.
Then select the new provisioning profile for your parent app in Build Settings->Provisionig Profile.
Finally Rebuild your project!
For me this was happening because some of my provisioning profiles were expired. Created new profiles on developer.apple.com, removed the old ones, set them to Automatic in Xcode, and the error went away.
In my case the profile my extension target uses contains different certificates than the profile the parent target uses contains. This was exactly the error messages complained about!
The reason was I generated a new certificate for the extension profile.
So log in to developer.apple.com to see if these profiles contains different certificate.
After a whole day it turns out "Apple Worldwide Developer Relations Certification Authority" in the Root Certs had been deleted. I export one from another machine and installed, everything works fine.
If you are using any extension (in my case I was using OneSignal Extension) in that case your parent app bundle will be com.app.xyz but for extension/widget your bundle id would be com.app.xyz.extension
So we will create an app id with the bundle identifier com.app.xyz.extension and we will create provisioning profiles for this app id.
We would use same development and production certificates which we used for parent app.
Here is link which can be helpful provisioning profile for a widget
Finally I am not using automatic settings. So I set my provisioning profiles and certificates manually
Check All targets select one by one and click signing & capabilities -> Select team
Then go for
Build settings->Signing Set all as per provisioning profile
Then
//:configuration = Debug
PROVISIONING_PROFILE =
//:configuration = Release
PROVISIONING_PROFILE =
//:completeSettings = some
PROVISIONING_PROFILE

Resources