renaming xcode project generates signing error - ios

(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.

Related

how and what is XCODE's Bundle ID, signing?

sorry new to IOS programming. must i enroll to apple developer program to obtain a bundle id ?
apparently i am trying to start my first project, but it seems like i need to choose a bundle idnentifier so that the signing tab would have no errors.
is the signing tab required for me to make a development environment on my device ?
Bundle identifier is on which uniquely identifies your app on app store, it is unique & hence 2 apps can't have the same bundle identifier's.
Example of a bundle id
com.azhar.calulator seems like this.
Signing of a code is required for running, testing & debugging of the app.It requires provisioning profiles and its certificates.
Procedure for getting them:
1.Run Google Chrome, Mozilla Firefox, or Safari.
2.In the iOS Dev Center, click Certificates, Identifiers & Profiles.
3.In the drop-down menu in the top left corner, verify that iOS, tvOS, watchOS is selected.
4.In the left-hand sidebar, select Provisioning Profiles → Development.
Click +.
5.Select iOS App Development and click Continue.
6.Select an App ID to associate with the provisioning profile and click Continue.
7.To be able to use one development provisioning profile across multiple apps, select a wildcard App ID, if available.
8.Select one or more certificates for development to include in the provisioning profile and click Continue.
9.Only certificates for development are listed.
10.Select one or more devices to include in the provisioning profile and click Continue.
11.Provide a name for the profile and click Continue.
12.(Optional) Click Download to download the provisioning profile.
13.Click Done.
The bundle ID is your application ID. It is the one you set when creating the project, and should look something like: com.darkArtistry.appName
What you need from the Apple Developer Program is :
1 - A valid developer to certificate to sign your application
2 - A valid provisioning profile, that matches your appID.
Provisioning profiles allow wildcards in some cases like com.darkArtistry.* so they can match more than one bundle ID.
I would recommend you to first get your certificate from the developer program, and then xCode will help you creating a provisioning profile for you.
There are a lot of guides out there, let us know when you are exactly stuck.

How do I create a new provisioning profile with entitlements?

I'm working on an app: com.myco.foo
It uses "Associated Domains"
I can't run the app on a physical iPhone due to this error:
Failed to code sign "my app". None of the valid provisioning profiles allowed the specified entitlements: com.apple.developer.associated-domains.
How do I create a new provisioning profile to sign this?
When I try to create my own by doing the following:
App ID's -> new (https://developer.apple.com/account/ios/identifier/bundle)
id: 'com.myco.foo'
enable associated domains
Provisioning Profiles -> new (https://developer.apple.com/account/ios/profile/)
type: development
select app id created above
select my device
finish creation
download
open (which opens Xcode but Xcode doesn't say anything about the profile that i opened)
I try to run on device, I get the error:
An App ID with Identifier 'com.myco.foo' is not available.
When I change the project app id to com.myco.foo2, I get the original error.
First I would say regenerate all Development (or Distribution if you are trying to archive) provisioning profiles for your application.
Then, add the associated domain capability.
From the Adding Capabilities section of Apple's App Distribution Guide:
To enable associated domains
In the Capabilities pane, if Associated Domains isn’t enabled, click the switch in the Associated Domains section.
Click the Add button (+) at the bottom of the Domains table.
Double-click the placeholder text in the table, and enter the domain name you want to add.
1) First of all make sure you have added your device udid in provisioning profile you are using. If not added, add it from developer.apple.com and download latest provisioning profile, it resolves your issue.
2) If you have not created Development and Distribution code signing certificates on developer.apple.com then ask relevant person for .p12 certificates.
Looks like it needs to be a distribution type profile in order to run on a physical device: when creating the provisioning profile, you have to choose "Distribution: App Store". You don't select any devices during creation.

Why does Xcode create non-wildcard app IDs called "XC Wildcard"?

I removed all my app IDs and provisioning profiles from Apple's Developer site. Then I created a new Xcode 7.3.1 project, and clicked "Fix Issue" next to the "no matching provisioning profiles found" message.
The app ID it created is called "XC Wildcard", but it's not a wildcard ID; it's set to the bundle identifier of the Xcode project. And the development profile it created is assigned to that app ID.
If I change the bundle identifier and click "Fix Issue", it creates a second app ID called "XC Wildcard", with the new bundle identifier, and another development profile for it.
This works, but seems wrong. Shouldn't it be creating an actual wildcard app ID, unless I turn on specific capabilities like Push Notifications?
Xcode create "XC Wildcard" to be used for debugging so it matches all app id's
change deployment configuration from debug to release and Xcode will create a provisioning profile with your app id.

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.

Invalid provisioning profile when submitting WatchKit extension?

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.

Resources