Jon
Jon

Reputation: 1115

"A valid provisioning profile for this executable was not found" deploying app from Visual Studio 2019

I get this error when I want to deploy Xamarin.Forms iOS app in my device:

Deploy Error: Could not install the application 'C:\Users\{myuser}\AppData\Local\Temp\Xamarin\HotRestart\Signing\{MyApp}.iOS.app\out\{MyApp}.iOS.ipa' on the device {My iPhone}. Details: ApplicationVerificationFailed({10 digits number}) - Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.OzsrZN/extracted/Payload/{MyApp}.iOS.app : 0xe8008015 (A valid provisioning profile for this executable was not found.)
2>Deploy failed. The app '{MyApp}.iOS.app' could not be deployed to the device '{My iPhone}'. Please check the logs for more details.

I'm using Visual Studio Professional 2019 Version 16.11.3 ​on Windows 10 Pro laptop. One month earlier I didn't have problems to deploy the app. My company (developer account) and my (individual account) certificates expired, so I created a new ones (development and distribution) and installed them in the macbook I use to pair with Visual Studio. Then I created provisioning profiles (development and distribution). I think that I installed the profiles using Xcode in the macbook.

In iOS project properties > iOS Bundle Signing > Bundle Signing > Scheme: Automatic Provisioning is selected. I have selected the only team I have (with my company name in it). In Custom Entitlements I have Entitlements.plist file.

As the error I get is about provisioning profiles I think that something is wrong with the provisioning profiles. How can I check if everything is correct in apple accounts o in the macbook?

Edit for additional information:

I have 5 provisioning profiles in Apple account > Certificates, Identifiers & Profiles > Profiles:

  1. My Name my app development 2021-2022 (type: Development)
  2. My Name wildcard development 2021-2022 (type: Development)
  3. My Company my app distribution 2021-2022 (type: Ad hoc)
  4. VS: com.mycompanyname.myapp Development (type: development)
  5. VS: WildCard Development (type: Development)

I realized that I have 2 provisioning profiles that I didn't create and start with "VS:". And it seems that this is which is used by Visual Studio.

In Visual Studio , when I change Bundle Signing Scheme from Automatic to Manual, and again to Automatic and then select the team, Visual Studio downloads the profiles. Xamarin output window:

Resolving certificate...
Fetching valid and locally installed signing identities...
Syncing certificates for "MY COMPANY NAME" team...
Saving Apple Development certificates...
Syncing App IDs for "MY COMPANY NAME" team...
Your application is using entitlements not supported by wildcard App IDs...
    * com.apple.developer.networking.wifi-info
Making sure that connected devices are registered in "MY COMPANY NAME" team...
Trying to find App IDs matching iOS platform and com.mycompanyname.myapp...
Syncing devices for "MY COMPANY NAME" team...
Processing ios devices...
Syncing provisioning profiles for "MY COMPANY NAME" team...
Saving iOS profiles...
Fetching additional data about profile's certificates and devices for VS: com.mycompanyname.myapp Development...
Downloading the list of devices and certificates for VS: com.mycompanyname.myapp Development...
Running update request for VS: com.mycompanyname.myapp Development...
Downloading provisioning profile: VS: com.mycompanyname.myapp Development...
Saving provisioning profile: VS: com.mycompanyname.myapp Development...

Is this profile a valid one?

The provisioning profiles are created using my individual account, should I create them using developer program account?

Upvotes: 1

Views: 5167

Answers (5)

logeshpalani31
logeshpalani31

Reputation: 1638

Sometimes, This error occurs with my visual studio also, even though with valid provisioning profile. I follow below steps to resolve this issue.

Create sample Native Swift Application in XCode with this same profile/certificate, and try to deploy. If any issues with profile, it will throw proper error message or it will pull the necessary information and deploy into the device.

Then don't delete the application, instead, deploy your visual studio app to device. if you have any issues, please compare the Entitlement.plist and info.plist.

This is my way to find the exact issue.

Note: Check Certificate didn't expired and The device UDID is update in the device portal.

Upvotes: 0

RobbiewOnline
RobbiewOnline

Reputation: 1370

If you have recently upgraded from Visual Studio 2019 to Visual Studio 2022 then you may have stumbled into the same issue as me

https://codingrob.medium.com/how-to-resolve-xamarin-ios-developer-provisioning-profile-hell-f29a998fa184

TLDR: The steps are to re-install Visual Studio 2019, then upgrade to Visual Studio 2022 (without enabling any iOS SDK checkboxes in the upgrade wizard), then launch Visual Studio 2022 and upgrade those iOS SDKs through ‘Visual Studio’ > ‘Check for updates…’ instead.

Upvotes: 0

LIJU DANIEL
LIJU DANIEL

Reputation: 138

  1. Check your profile is valid
  2. Try to generate an ipa file in release mode using development profile. Then install the ipa in your device using Xcode (Window -> devices and simulators -> drag ipa to device). & Ensure the ipa is working
  3. Check your Entitlement plist and Enable/Disable push notification & try to debug again.
  4. If not working; please install latest version of visual studio which support your xamarin ios version & Try debugging

Upvotes: 0

Wen xu Li
Wen xu Li

Reputation: 1686

You could clean the prodfile in your mac, and delete the certificate in the Keychain(The blue file in the keychain), then re-created the profile.

if you use Xcode

  • Go to Xcode --> Preferences --> Account.
  • In the provisioning profiles section, right click and open with finder.
  • Delete all provisioning profiles from the provisioning profile folder.
  • Finally, go back to Xcode and click the refresh button.

You can also refer to this link(https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/) to check if there is a problem with your configuration process.

Upvotes: 0

Ninaada Bellippady
Ninaada Bellippady

Reputation: 78

Automatic provisioning gives errors like this at times.

  1. Delete the old certificates and the provision profiles.
  2. Create new provisioning profiles using the new certificates.
  3. Download them.
  4. Make sure that you have selected the same provisioning profile.
  5. Uninstall the app from the device.
  6. Clean and try running it.

Upvotes: 0

Related Questions