Code Signing required 'WatchKit Extension' in SDK 'watchOS 3.2' - ios10

I have migrated watchOS 1 to watchOS 2. So I had to change the extension Bundle id with a prefix from
App my.app.com
Watch my.app.com.watchkit
Watch Extension my.app.com.watchkit.extension // old one was -> my.app.com.extension
After updating the bundle id I am getting an error like this when trying to upload to the App Store on Fastlane.
Provisioning profile "app-distribution-provision" doesn't match the entitlements file's value for the application-identifier entitlement.
Code signing is required for product type 'WatchKit Extension' in SDK 'watchOS 3.2'
I also created a new .mobileprovision for Watch Extension and added it to XCode. However I am still getting this error when trying to upload App Store. Do Should I update .p12 file? Any help would be appreciated.

Since you changed the bundle identifier of the Watch Extension, you also need to update the bundle identifier in the Entitlements file for the Extension. You can see the location of the entitlement file in Build Settings under "Code Signing Entitlements".

Related

ERROR ITMS-90283: Invalid Provisioning Profile error for macCatalyst with Universal Purchase

I am trying to submit a new app developed by macCatalyst and by using the same universal purchase option in the appstoreconnect.
I enabled the new option use IOS Bundle identifier in XCode 11.4
So, my IOS and Mac version of apps use the same bundle identifier
I enabled the mac platform in appstore connect
I can build, run and archive my project successfully but when I try to upload or validate it I get the following error at the end of the upload:
ERROR ITMS-90283: "Invalid Provisioning Profile. The provisioning profile included in the bundle com.XXX.XXX [com.XXX.XXX.pkg/Payload/XXX.app] is invalid. [Invalid 'com.apple.application-identifier' entitlement value.] For more information, visit the macOS Developer Portal."
I get this error only when I upload macCatalyst version of my app. There's no problem about uplading and/or validating the IOS version.
I've already tried, deleting and redownloading of all profiles, refreshing automatic signing, refreshing entitlement file but none of them worked.
Thanks in advance.
Double check that the items enabled under "Signing and Capabilities" in Xcode is the same as in Certificates, Identifiers & Profiles
Xcode 11.4.1 added some extra when I added macOS as target, after removing the ones the app didn't use the ERROR ITMS-90283 error went away.

.ipa file using xcode 4.6.1

I am new to iOS and I am developing my first app for the App store.
I now have to generate my .ipa file using archive options from organizer. I am selecting iOS devices at run tab and used the archive option but it is showing the following error:
"The identity 'iPhone Distribution' doesn't match any valid, non-expired certificate/private key pair in your key chains"
I am not attaching my device to Xcode. I want to create .ipa file for sending it to one of my friends for testing using his iPhone.
A quick fix: on your Xcode project, look for a folder called "Products", and find your .app file there. You will need to create a folder called "Payload", and put the .app file inside that folder. Once you do this, you can compress the folder, and change the name to yourapp.ipa file. This will be a valid .ipa file signed with the provisioning credentials you used to compile the file.
Keep in mind that the proper way to set up this is to setup a schema for archive, in which you sign the app with the "release" settings, and with a valid ad-hoc distribution profile. But for now, you can use the initial quick fix so you can send your friend the app.

Adding entitlement file

I need to submit my app to the App Store. So before I do this, I validated my application using Xcode's validate process.
When submitting for Validation, it required a entitlement file to be added to the project. I was unable to create this file so I dragged an entitlement file from another project and included in mine. This entitlement file did not contain any data in it (it was an empty file). However when I submitted it to validation through Xcode the validation passed successfully.
What I want to know is, What does a entitlement file do (since the entitlement file included in my project is empty) and will my app get rejected from appStore for dragging and dropping an entitlement file from another project?
According to Apple Reference
Entitlements confer specific capabilities or security permissions to your app.
Specifically
Set entitlement values in order to enable iCloud, push notifications, and App Sandbox (App Sandbox is Mac OS X only). Each entitlement has a default value, which in most cases disables the capability associated with the entitlement. When you set an entitlement, you are overriding the default by providing an appropriate key-value pair
Entitlement file is just a plist file, you can see it as another setting file that include a few highlevel configuration and is essential for code-signing an adhoc build prior to xcode 4.x
Empty entitlement file is valid as XCode will treat empty entitlement file as you want to use all the default value specified by Apple's reference. Leaving an entitlement file in your app project won't cause any harm, unless you specify something that your app is not capable of , i.e. icloud storage. Better to just delete that file if you don't need local distribution. :)
According to Apple Technical Note TN2250 (I recommend you to get rid of the entitlement file)
If you are defining a custom Code Signing Entitlements file within
your Target > Build Settings, you might try removing that
configuration entirely and rebuilding/resubmitting. More often than
not, Code Signing Entitlements are defined unnecessarily. You only
need to specify a custom Code Signing Entitlements file if your
application is utilizing custom keychain access sharing or iCloud.
Otherwise, remove the Code Signing Entitlements configuration from all
build configurations on your Xcode project's Target > Build Settings,
the rebuild and reattempt your submission/validation.
Specifying a code signing entitlements file unnecessarily is the most
likely cause of errors such as -
The app 'Foo' was not installed on the iPhone "foobar's iPhone"
because the entitlements are not valid.
In most cases, those entitlements seen above should be the only
entitlements in your App's Signature. Applications using Apple Push
Notification or iCloud will add a couple entitlements. Otherwise,
extra entitlements than those listed above, or improperly spelled, or
formatted versions of those entitlements will likely result in "failed
codesign verification" preventing upload to the store, or for Ad Hoc
builds produce the iTunes installation error 'the application was not
installed because the entitlements are not valid'.
Please see Reference

How to get ipa file from Xcode to run an iPhone app in real device?

My client asked me to get the review of the app on which I am working. So, I want to get the ipa file and mobile provision file from Xcode 4.2 to share my app to run in real device. I have a paid account of apple with me. Please tell me the procedure to get it.
Thanks in advance.
STEP-1:
You need to refer steps for AdHoc Distribution
I think you need to login with your credentials at Developer Apple Login
Once you are logged in go through this link and read through it step by step.
I think this is the best solution you can get as this documentation guide is given by Apple
https://developer.apple.com/ios/manage/certificates/team/howto.action
This has multiple steps like:
1. Generating a Certificate Signing Request
2. Submitting a Certificate Signing Request for Approval
3. Approving Certificate Signing Requests
4. Downloading and Installing Development Certificates
5. Saving your Private Key and Transferring to other Systems
I think if you read all this steps on the apple documentation at the given link then you don't need to refer to any other guide.
STEP-2:
Then just you need to download your certificates and provisioning profile.
STEP-3:
Just set the profile into your Project and Target Settings and then put proper Entitlements using "Entitlements.plist".
STEP-4:
Once you have done that, just set up your project in AdHoc Scheme.
STEP-5:
Clean your Project.
STEP-6:
Go to Product -> Click on Build For -> "Build For Archiving"
STEP-7:
Product -> Archive
Now your Archive can be obtained in your Organizer where in you can save it to disk with an IPA extension and send it your client.
EDIT:
Here are some of the useful links you can refer to for creating provisioning profile and IPA file:
Create IPA file in Xcode 4.2, iOS 5.0 Beta
http://www.makebetterthings.com/iphone/how-to-create-ipa-file-for-your-iphone-app-xcode-build-and-archive/
http://www.wikihow.com/Create-a-Provisioning-Profile-for-iPhone
Create provisioning profile in iphone application
Hope this helps you.
If you want to test application on device, then you need to create debug profile for it. You need to get it for your device from the provisioning section of developer portal. If you are creating the distribution profile, then you need to put the generated ipa file from build folder to itunes to install it on device.
Then you can install the application on device. But in that case you will not be able to see the logs.
So if you want to see the logs in Xcode console, Create a developer provisioning profile for the device & install it on XCode & then run the code on device using Xcode.
Maybe I think this is the entitlements.plist problem please follow the steps
In XCode, go to "new file" and select "code signing" in left box. Select the "Entitlements" file type. And change the name to "Entitlements.plist". Give the name in project getinfo entitlements plist please check the image below
• Get their device ID and add their device to "Devices" in your iOS Provisioning Portal
Create or edit a distribution profile to include their device (wildcard app id or your app's app id)
• In Xcode: Product -> Archive
• In Xcode's Organizer: Go to archives and "Share" your archive. This creates an ipa that you can give to your client
• The client can install it in iTunes by adding the ipa and syncing apps (I haven't done this last step in a while)
OR
Get to know testflight. Using testflight will replace the final step above and streamline the installation process for your client.
After build with your provisioning profile or distribution for device(not simulator). You can follow this tutorial.
It can be done, in fact I just did it.
After Xcode 6 you have to go to:
Product-->Archive
Then wait for it to finish. Then on the screen that pops up right click on your newly created archive-->Show file in finder
Then head there with a terminal and run this command on that dir:
xcodebuild -exportArchive -archivePath <PROJECT_NAME>.xcarchive -exportPath <PROJECT_NAME> -exportFormat ipa -exportProvisioningProfile "Name of Provisioning Profile"
DONE
For example this command for me was:
xcodebuild -exportArchive -archivePath ACCESS\ 04-02-16\ 02.21.xcarchive/ -exportPath MyTestApp -exportFormat ipa -exportProvisioningProfile "iOS Team Provisioning Profile: eu.sudoplz.myTestApp"
This created a MyTestApp.ipa file for me.

Not Jailbroken - getting Provisioning is not applicable for product type 'Application' in SDK Device

Codesign warning: provisioning is not applicable for product type 'Application' in SDK Device - iPhone OS3.1'; ignoring..
Redownloaded my developer certificate, made a new provisioning profile, still getting this error. Searched the Xcode project and removed all lines referencing a Provisioning Profile, but that didn't seem to remove it from the project settings (went to show package contents, then opened the project file).
Was originally on a different machine then transferred over, if that makes a difference?
Thanks
Check the file
/Developer/Platforms/iPhoneOS.platform/Info.plist
and make sure the following keys are set to YES
<key>PROVISIONING_PROFILE_ALLOWED</key>
<string>YES</string>
<key>PROVISIONING_PROFILE_REQUIRED</key>
<string>YES</string>
When developing for a jailbroken devices, these should normally be set to NO, so you can self sign and copy the file over, etc, but it's not necessary to skip this when you actually have a proper certificate and provisioning for your device.