Xamarin Studio not Recognizing Provisioning Profiles - ios

I'm at my wit's end with these apple certificates. I have a Xamarin.Forms app that I need to sign with a provisioning profile so I can enable push notifications. However, Xamarin Studio isn't recognizing any of the provisioning profiles that I'm making. Can someone please help?
Xamarin Studio trying to link provisioning profiles, profile 23devpp not found:
Xcode finds prov. profile 23devpp:
Developer window has provisioning profile marked as active:

EDIT: Here's the solution
The Bundle Identifier in your Xamarin iOS project's Info.plist has to match the one in the App ID you used for your profile. I just tried this and i replicated your problem - when i corrected the Bundle Identifier my test profile showed up
(I want to make this a comment but I can't yet) Sorry but have to ask the stupid question- did you try restarting Xamarin?
Note: It is sometime necessary to stop and restart Xamarin Studio before it will see any new or modified certificates or profiles updated by Xcode.

There is a potential second reason you can't find your provisioning profile in Xamarin Studio, if the bundle identifier in the accepted response above matches: Your Signing Identity must match the Provisioning Profile you're using. If you have generated new certificates for signing the app, e.g. because your old certificate was about to expire, Xamarin Studio won't necessarily have access to the new certificate's private key. This is required in order to display the correct Signing Identity and associated Provisioning Profile in Xamarin Studio.
To check if this is your issue, sign in to Apple's Developer Portal -> Certificates, Identifiers & Profiles -> Provisioning Profiles. Select the profile you want to use, and note the "Expires" date of the profile.
Then, open Keychain Access and find the signing certificate with the matching "Expires" date under Certificates. It should be possible to expand the certificate, and a private key should appear when you expand it. If you don't have a private key for the certificate, or if the certificate itself is missing, you have to install the certificate with its associated private key.
To do this, either generate a completely new certificate in the Developer portal, or get someone else on your team to export the certificate with its private key. You install it by double-clicking it on your Mac and entering its passphrase.

1.Go to Xcode, create a new project.
Select your company name(do not select user), then type in anything you want as your bundle identifier.
2.Go back to Xamarin studio and change the bundle identifier to match the one you just created in Xcode.
3.Update the provisioning profile in options to include the bundle identifier you created in Xcode. Build, then Debug the solution and it should work.
For me the issue was the team identifier contained the only provisions, and the only selection in Xamarin studio were users. I just created a new project in Xcode that pointed to the team provision, then used that new bundle identifier (that was uploaded to the Apple dev site) in Xamarin studio.

In case anyone else comes across this post while (it was the second hit for me when Googling this error now), my issue wasn't quite any of the above.
The profile I created in Xcode was based on com.company.myapp, but the identifier in Visual Studio was com.company.MyApp. The case sensitivity matters. However, when changing in Xcode to match VS, it kept failing with an error. I had to append a number to the end, so both then read com.company.MyApp1 - and then it worked (after restarting VS).
Just in case it helps anyone else.

In my case, Visual studio was listing my provisioning profile but the issue was its not updated.
Problem :
XX.mobileprovision was generated with 10 devices and some entitlements.
Client asked to add some more device and entitlements were also modified to support new features.
installed XX_new.mobileprovision
The problem I faced, Visual studio was considering old PP, not new information which I installed through XX_new.mobileprovision
Solution :
Visual studio takes this provision profile from, ~/Library/MobileDevice/Provisioning Profiles
Go to this directory and delete corresponding provisioning profile.
Install XX_new.mobileprovision and you are good to go, Visual Studio will recognize all the changes of profile and list of profiles will also be updated.

For those of you using Xamarin.Forms on Visual Studio 2019 (Windows):
In the Solution Explorer window, right-click the iOS project > Properties.
Click iOS Bundle Signing (on the left) and enter your Apple ID (case sensitive, it must be the same as the Apple ID in XCode on your Mac).
Save your changes. The progress indicator will run forever (Running automatic provisioning), it must be a bug. Just close the tab and build your project.
NOTE: If you don't have your Apple ID in XCode on your Mac. Go to you MAC:
Open XCode.
From XCode menu, choose XCode > Preferences, then click on the Accounts tab and configure your Apple ID.
Don't forget to restart Visual Studio 2019.

Related

Another No iOS signing identities match the specified provisioning profile error question [.NET MAUI]

I know there are a million other questions for this error and I've tried pretty much all of them no avail.
I try "Automatic Provisioning" as well as "Manual Provisioning" and nothing's working so far and I'd appreciate some fresh suggestions.
This is the error:
I first tried it with "Automatic Provisioning" and the settings look like this:
I try to build it in Visual Studio for Mac 17.4 (Build 2406) using Release and Generic Device settings and I end up with this error.
I then tried using "Manual Provisioning". When I select this option, I get "Bundle Signing Options" button. When I click it, I see this:
This is the entry in the myproject.csproj file:
And in Visual Studio > Tools > Preferences > Publishing > Apple Developer Accounts, I see this under "Provisioning Profiles":
The provisioning profile name I see in myproject.csproj file and under Apple Accounts match exactly.
Any suggestions on how to fix this issue?
I give you some suggestions from the following aspects:
To check whether the profiles matches the certificate. The BundleID and the Sign Identity of the project should be the same as what we have chosen when creating provisioning file. I think this doc Provision an iOS app for app store distribution is a good example to show the workflow of creating a provisioning file.
Use Xcode to download and manage the certificate and profile as Visual Studio sometimes gets trouble when syncing data. Restart Visual Studio for Mac after downloading the provisioning file. You could refer to Download the provisioning profile on your Mac build host
Hope it works for you.

Error adding Apple Developer Account: authentication service is unavailable

I’m trying to add an apple developer account to VS 2019 Community ver. 16.9.2 for Windows.
Once I set the Apple ID and Password and click on Login, I get the following message:
“There was an error while trying to log in: Authentication service is unavailable.”
The Apple ID and Passwords are correct, in fact, if I type in the wrong credentials then Visual Studio complains about invalid id/password combination.
I disabled the firewall during the process so this should not be a connection issue.
Also, I made sure I have no pending agreements on Apple Store Connect. My apple developer account is valid and has no issues. In fact, I can use the same account on xcode just fine.
Is there some workaround?
THIS ISSUE IS FIXED IN THE 16.9.6 VISUAL STUDIO UPDATE !!!
(old workarounds)
There are some workarounds but none of them worked for me and updating to the latest version didn't help either (Visual Studio 2019 16.9.4). For as far as I know this issue persists even on version 16.7.5 of VS2019. For some people the workarounds seem to work so I will list them here so hopefully some of us can get on with our projects.
Workaround 1 (offered by Xamarin team):
Close Visual Studio 2019
Delete the following folder %LOCALAPPDATA%\Temp\Xamarin\XMA
Open project -> clean sollution
Set Automatic for bundle signing in the iOS project settings
Rebuild
(- if it doesn't work try again after restarting pc)
Workaround 2:
Delete your apple account from VS2019 through Tools–> Options --> Xamarin–> Apple Accounts
Sign back in again
Download your provisioning profile from developer.apple.com account to you pc
Copy and paste it into: \Users\YOUR_USERACCOUNT\AppData\Local\Xamarin\iOS\Provisioning\Profiles
If it doesn't work, perform in combination with workaround 1
Workaround 3:
Delete apple account from VS
Remove certificates from AppData\Local\Xamarin\iOS\Provisioning\Certificates
Remove profiles from AppData\Local\Xamarin\iOS\Provisioning\Profiles
Add Apple account
Set to Automatic Provisioning and select team, it will error again but will reinstall the certificates
Manually download provisioning profile and copy it to - AppData\Local\Xamarin\iOS\Provisioning\Profiles
Run the archiving process should error out again but the “id” or name of the provisioning will be displayed in the error
Rename the provisioning file to match and rerun archiving.
As I said these workarounds don't work for me but I hope they do for you. If it doesn't then you're in the same boat as me and you're going to need to follow this thread:
https://developercommunity.visualstudio.com/t/Error-adding-Apple-Developer-Account:-au/1380749?viewtype=all
I was able to use a combination of several workarounds from Michael's answer to get the app signed and deployed on an iPhone (for debugging). Here are the steps in correct order that worked for me:
Set Automatic for bundle signing in the iOS project settings
Delete your apple account from VS2019 through Tools–> Options --> Xamarin–> Apple Accounts
Close Visual Studio 2019
Delete the following folder %LOCALAPPDATA%\Temp\Xamarin\XMA
Delete all "obj", "bin" and ".vs" folders for the solution
Download your provisioning profile from developer.apple.com account to you PC and save it to %LOCALAPPDATA%\Xamarin\iOS\Provisioning\Profiles
Open Visual Studio 2019
Add your apple account from VS2019 through Tools–> Options --> Xamarin–> Apple Accounts
Build. It will error out while signing the app.
Look at the error. It should specify the expected file name for your provisioning profile. The file name is a long string of hex digits with extension ".mobileprovision".
Go to %LOCALAPPDATA%\Xamarin\iOS\Provisioning\Profiles and rename your provisioning profile file into file name from the error message.
Build again. It should work now!
I just went through the exact same problem and it took forever to work out. I'd had my app running locally and debugging on my iphone just fine. A few months later this bug popped up... I needed to simply update iTunes. iTunes handles the handshake stuff for your iOs devices and Windows.

Packaging and distributing Xamarin iOS app using VS for Mac

I am having some trouble using my distribution profile to package my app.
So the development profile works fine. I just set the correct bundle id in my Info.plist and in my Visual Studio for Mac project options, just set the iOS bundle signing to my name (the option appears as: Developer: Name (some sort of ID)) for the signing identity and "Name of Development Profile" as the provisioning profile- this correctly loads the app onto the phone as we would expect. However, when switching to Distribution (the only option for this seems to be "Distribution - Automatic"), no matching provisioning profiles are found. The same thing happens if I package the app and then try to sign/distribute it (no matching provisioning profiles found).
I have double clicked on the provisioning profile which opens XCode and also I have clicked Download profiles on my user account in XCode (based on documentation it looks like either of these should correctly load it), so according to Xamarin's docs I should be doing everything correctly, but VS doesn't seem to see the Distribution Profile at all. What is the issue here? Do I need a separate signing identity?
It turns out that yes, you do need a distribution signing identity to go along with your distribution provisioning profile. I obtained the distribution cert for my team's account and added it to my Keychain Access and Visual Studio for Mac was able to now use my distribution profile to package the app.

Could not find any available provisioning profiles for iOS

We are developing a iOS shopping cart application in c# and visual studio 2017 for xamarin. I have an iPad Air iOS 10.3, when I try to publish to real device, I am getting the following error message: "Could not find any available provisioning profiles for iOS", I have tried to restart my Mac - without result. Give me any suggestion to resolve this issue?
In Visual Studio for OSX, go to Visual Studio Community > Preferences > Publishing > Apple Developer Account and click to + button to sign in and add your developer account. In theory after that automatic provisioning should work.
In Visual Studio for Windows, go to Tools > Options > Xamarin > Apple Accounts, you will get a prompt to install FastLane before your Apple ID will show up under Automatic Provisioning.
You must create a provisioning profile. Search on Google, how to do it.
But, the secret is: when you create a provisioning profile, you must associate an App ID to this profile, like: "com.companyname.*".
When you create your app in visual studio, you must set in the INFO.PLIST file on IOS PROJECT, the Bundle Identifier to "com.companyname.myapp1" or anything else.
If your Bundle Identifier has a name like "com.myapp.app1", you will get this error: Could not find any available provisioning profiles for iOS, because your profile accept only apps with the names started with com.companyname and you are using a appname different.
For those who just want to deploy/test their app on a real device with "Free provisionning" follow this official guide.
To sum it up :
Create an apple id
Add the previously created apple id to XCode in order to add a provisioning profile.
Create a new empty iOS app with the bundle identifier equals to the one of your Xamarin app (you can find it in Info.plist of your Xamarin.iOS project).
Ensure that your empty iOS app could be deployed, by running it from XCode on your device with your free provisioning profile.
In Visual Studio open Info.plist and click on Bundle Signing Options..., in Signing identity chose Developper automatic and Automatic in Provisioning profile.
Run your Xamarin.iOS app on your device.
You can see what was wrong with your provisioning profile in xCode. Also this procedure will update Provisioning profiles, Certificates, App Ids:
Go to xCode, create blank iOS application, type the same Bundle Identifier, that you had in Visual Studio.
On the same page uncheck "Automatically manage signing".
In Signing (Debug) click on Provisioning profile. You will see Eligible and Ineligible provisioning profiles. You can select each of them and if one is Ineligible, then errors will be shown below. After that you can fix them.
After that you can go to Visual Studio for Mac and create the same project with the same bundle id and check you profile in Project -> Options -> iOS Bundle Signing -> Provisioning profile
After that you will find your Provisioning profile in Visual Studio on Windows
I suggest you read this documentation to learn more about iOS provisioning.
What you want is called automatic provisioning though. It takes care of all the complex things about provisioning for you and just deploys the app.
Visual Studio on Windows has the automatic provisioning feature in preview (called 15.7) right now (preview 3): https://learn.microsoft.com/en-us/visualstudio/releasenotes/vs2017-preview-relnotes#xamarin-provisioning.
I recommend you try that, it should help you automatically add your iPad to the relevant provisioning profile.
Visual Studio for Mac has had automatic provisioning for a couple releases now.
Note: you do need an Apple Developer account to deploy on device (it can be a free developer account).
Unbelievable but true...
To enable the interface, I first had to login with my Apple account under:
https://itunesconnect.apple.com
and
https://appleid.apple.com
and agree the new privacy agreement from Apple. There isn't any error message that points you in this direction ("you first have to agree...").
After doing that, I was able to use the automatic provisioning in VS2017 and connect to the Mac.
All of these answers are right.
There are many reasons the creation of the provisioning profile certs bundle can fail. The one I dont see listed here is referenced in (Apple developer account teams not showing up on VS Mac)
Only XCode can set up the provisioning for you using the free apple dev Id. You need to create a dummy project with the same Bundle Name and Bundle Identifier. Build it in XCode and have XCode create the certs for you.
Only once i did that (on the paired Mac) did it start actually building my iOS target in Windows VS 2017
How did I have to solve this?
First background
I have already provisioning profile for app we are building but every once in a while I have to create a small POC app to prove something. And often I have to use that small app on real provisioned device.
But I was not even able to see my device for that small POC app in the dropdown showing available devices. Only the app I am building with my team will show.
Solution
To resolve this, I had to do
In my POC app > Info.plist, make sure your Bundle Identifier is same as for the app that you can deploy to your device
At the same location, under Signing, select "Automatic Provisioning" and you should see your Apple ID show. In Team dropdown, select your team
After this, my device showed, I was able to build and deploy to it and the error was gone.
I have tried all the above-mentioned approaches but didn't work. I was using Manual provisioning.
To identify why it's not showing in VS, I have:
Opened the Xamarin.ios project in Xcode.
Under Settings > Manual provisioning profile,> Selected the appropriate certificate (Note: It should be installed before it appears in the list).
It showed me an error, which said "Selected provisioning doesn't match with the distribution certificate in the keychain"
When I logged into developer.apple.com - I have found a new distribution certificate.
I had to regenerate the provisioning profile with the new distribution certificate (selected) and installed it.
After installing the error went away.
Also, In the Visual Studio's drop-down list the provisioning profile started to appear.
I agree with Meekohi & Vincent Dondain who have recommended choosing Automatic Provisioning, as it's a better option if one is not facing any issues with certifications or profiles as it takes care of everything. However, using the latest Visual Studio for Mac is preferable.
just hit the same problem. didn't find solution in this thread that i came to.
Xamarin app, visual studio for mac . manual signing
didn't use it for few months.
works good on emulator but can't deploy to device for debugging
after reading this thread went to developer.apple.com and found, that my developer profile expired a month ago.
create new provisioning profile
visual studio for mac-preferences-apple developers account-details-download manual profiles
info.plist-bundle signing options-choose correct identity and profile
Answer ( I have had this issue 2 times by switching MACS & adding new applciations )
Issue: Profile not showing up in dropdown below ( Automatic Distribution or Distribution )
As long as you are sure your info.plist is ok and have matching ( com.companyname.something ) & your CERTS are in Keychain then this is what is what cleared it up for me 2 TIMES !
** This seems to be some sort of refresh issue ( where a old profile is cached OR newer profile/bundle not loading in MAC )
[ I use VS on Windows and connect to MAC ]
Open Visual Studio for MAC ( not windows )
Create a new ( blank form ) iOS project
Click Visual Studio in Menu and Click Preferences
Click Apple Developer Accounts ( ADD YOUR APPLE ACCOUNT )
CLICK VIEW DETAILS & DOWNLOAD ALL PROFILES & Close
Open info.plist in your Folder View in VS
Check Manual Provisioning & Type in bundle Identifier com.companyname.whatever & App name
SAVE
RUN BLANK APP & CLOSE IT
10 ********* Go back to Windows right click on iOS Project Select Distribution AND YOUR BUNDLE IS IN THE DROP DOWN !!
[ If bundle not there re-connect to MAC right click and see if its there in your dropdown - remember the bundle must be in your iOS project ( root ) ]
( Automatic distribution will work as your bundle will be in the dropdown below in Windows Visual Studio & RELEASE TO APP STORE ).
One of the reason could be that there is no Provision profile file
For MAC the path is /Users/apple/Library/MobileDevice/Provisioning Profiles
You need to download the corresponding provision file from apple developer account and then paste it here in the above directory
Then, it will start reflecting in Visual Studio
Make sure you have a valid development certificate, it is added to your Keychain, and that you are signed into Xcode (Settings > Accounts).

iPhone code signing key doesn't match provisioning profile "xxxxxxx"

For about 17 weeks I've been building an iOS app using Xamarin Studio. I've added an iPhone to the developer profile and edited the provisioning profile to include this new iPhone, to test and debugg my app (I was running it on my MacBook (but with OSX Mavericks 10.9), and all worked well.
Last week, my supervisor asked me to upload the app to another iPhone, to show a demo of the app to our customers. I added the device in the developer portal, and linked it to the already existing Provisioning Profile. When trying to run the app, I got the error: "No iPhone code signing key matches specified provisioning profile".
A coworker and I have tried to resolve this issue by importing Certificates and Keys from another MacBook, on which the app still ran, onto this MacBook. After that didn't work out, we tried deleting the Certificates and Private Keys in the Keychain on this MacBook and re-importing them from the other MacBook.
We tried to create a new Provisioning Profile and re-link both iPhones, but the error still occurred.
Now, the app won't even sign on the first iPhone I linked to the first Provisioning Profile in the developer portal, nor will it sign using the emulators in Xamarin Studio
What I wanted to ask was what makes this problem occur, and how to fix it. Do we need to create a new certificate and provisioning profile altogether, or is there something we can do to fix this problem without having to create new certificates and provisioning profiles?
I've contacted Apple Support, they redirect me to Xamarin. Xamarin redirects me to Apple Support... I just can't get help from the officials, so I'll try the community.
Any help would be much appreciated.
1.Go to Xcode, create a new project. Select your company name(do not select user), then type in anything you want as your bundle identifier.
2.Go back to Xamarin studio and change the bundle identifier to match the one you just created in Xcode.
3.Update the provisioning profile in options to include the bundle identifier you created in Xcode. Build, then Debug the solution and it should work.
For me the issue was the team identifier contained the only provisions, and the only selection in Xamarin studio were users. I just created a new project in Xcode that pointed to the team provision, then used that new bundle identifier (that was uploaded to the Apple dev site) in Xamarin studio.
I know it's tedious, but I would start over re-creating certificates and profiles.
You could follow this lovely step-by-step guide: Publishing to the App Store
you have assigned wrong developer and with your provisioning profile.
select it right on going into build setting>> code signing and select provisioning profile you create with developer account.

Resources