问题
I'm trying to test my app on my device and am hitting the error stating "A valid provisioning profile matching the application's Identifier 'com.mycompany.MyApp' could not be found". I've read many similar posts here on SO but none have been able to help.
What I've done so far:
created a valid Provisioning Profile on the Provisioning Portal. When I look at the App ID of the profile, it is 10CHARSEED.com.mycompany.MyApp (where 10CHARSEED is obviously the Apple-generated seed id)
downloaded and installed the profile in XCode Organiser, under the device name. XCode has the green tick and tells me it's a Valid Profile.
checked that the Info.plist Bundle Identifier matches this. It does, exactly.
manually looked inside the project.pbxproj file for references to "PROVISION" but there are none (some of the other solutions I found on SO said to remove these lines, but obviously I don't have any to remove).
Quit Xcode and restarted.
removed and re-added the Provisioning Profile in Organiser.
Any ideas?
回答1:
Ok, solved. The problem was to do with permissions. I finally found the menu option in the Organiser that says Refresh from Developer Portal (which is strange because the Prov Profile I'd just installed came from the portal, so I'm not sure why it would be any different). Anyway I clicked it and it asked for my Apple ID, and then after a minute it came back and said that I didn't have permission to add App IDs and to get an admin from my team to do it. So illogical given that I could install them manually under my account. Anyway, I just got my admin to make my membership also an admin, which he was happy to do because I've been bugging him all day during the provisioning process. After doing that, I again refreshed from portal and it gave no error, then I was able to build and deploy to the device.
回答2:
I'm passing this along for the sake of completeness.
I had tried "bobsmells" (and, sorry to hear that Bob) recommendation, but was still getting the same error. It was a guesstimate on my part to check the Build Settings in Xcode to see if there was anything that stood out as being a possible red flag ...
As I had already created and could see my provisioning profile both on Apple's provisioning portal as well as within Xcode's Organizer Devices tab I knew the profile existed, and was in the proper locations (Xcode and the Portal).
I simply went to the Project Navigator > Targets (your_target_name) > Build Settings > Code Signing, and noticed the value was "iPhone Developer" under the "Automatic Profile Selector (Recommended)" heading.
The solution was to simply select the "iPhone Developer: (your_name_here)" located under the "iOS Team Provisioning Profile: * (for bundle itendifiers '*') heading.
In other words, use the provision profile I just created. Perform a Clean, Build, then run it. That did the trick.
Hope this helps someone ...
回答3:
i had a similar problem,i solved it like this,go to organiser and select provision profile you want to use and from app identifier copy the part from .in(e.g., ".in.appstute.abcd").After this go to project (in blue color),click targets(your project name),go to summary- bundle identifier paste what u have copied here and run.it worked for me.
回答4:
i was dealing with this problem forever, and similarly, quitting and reopening xcode and then refreshing from developer portal did the trick. interestingly, i guess because i am using a wildcard app id, i don't have to manually change the bundle id in the xcode project's target.
回答5:
If you saved your .developerprofile file outside of your project's root directory, just move it back in the Finder and then drag the file into XCode's "Project Navigator." Make sure the copy to target checkbox is checked.
来源:https://stackoverflow.com/questions/13226284/valid-provisioning-profile-matching-the-applications-identifier-could-not-be-fo