'Xamarin.iOS ApplicationVerificationFailed: Failed to verify code signature of

why I am getting this error when I am trying to run my application in real device not simulator

ApplicationVerificationFailed: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.ttjwEf/extracted/DSP.IOS.app : 0xe8008016 (The executable was signed with invalid entitlements.)
error MT1006: Could not install the application '/Users/macbookpro/Documents/gitProject/DSPMobileGit/DSP.Mobile/DSP.iOS/DSP.IOS/bin/iPhone/Debug/device-builds/iphone6.2-9.3.5/DSP.IOS.app' on the device 'Mohamed’s iPhone': Your code signing/provisioning profiles are not correctly configured. Probably you have an entitlement not supported by your current provisioning profile, or your device is not part of the current provisioning profile. Please check the iOS Device Log for details (error: 0xe8008016).

here steps I did to run my app

First I created project in Xcode with same bundle name and let Xcode handle Provisioning

when I tried to run in Visual studio it dosent work

Second I create manual provisioning with wild id but it dosent work

I note something each time I set my signing identity and provisioning profile , when I back to screen I find it back to none again

may be that is the reason

enter image description here



Solution 1:[1]

Using Visual Studio for Mac 2019

First, determine whether the problem is entitlements. Find tab "Deploying to Device", and look at the full message starting with "ApplicationVerificationFailed: Failed to verify code signature of ..."

Look for:

... The executable was signed with invalid entitlements.

In that case, see https://stackoverflow.com/a/43055084/199364.


The below answer is for the other likely situation:

... no valid provisioning found for this device.

On newer versions of Visual Studio for Mac + Xamarin iOS (or Xamarin Forms, deploying to iOS):

  • Connect the phone to Mac via USB cable.
  • Popup on phone, select "Trust" this computer.
  • In VS, Open Info.plist.
  • Make sure the "Application" tab is selected at the bottom of the pane.
  • Select "Automatic Provisioning".
  • Follow the instructions.

When successful, you'll see (below "Automatic Provisioning" radio button):

  • Apple ID: your-apple-id-email
  • Team: your-company-name-or-your-developer-name
  • (Green checkmark) Ready to deploy app to connected device.

IMPORTANT:

  • Even if you have previously setup Automatic Provisioning for a different device, you still need to open Info.plist / Application tab after attaching this new device. (After doing this once per device, you can switch which device is attached, without repeating.)
  • If Xcode has never seen the device before, it can take MINUTES before Xcode has validated it and attached it. See following paragraph if you'd rather see Xcode giving you a message about what its doing (and spinning a busy indicator). Won't be any faster, but is more obvious that something useful might be happening. (On older Xcodes, people have reported delays up to 10-15 minutes.)

If having trouble getting it to see your phone, google for instructions to open XCode and add your phone as a device known to XCode (XCode menu Windows / Devices and Simulators / Devices tab). That is, it may be easier to first get it working under XCode, then go back to VS, disconnect and reconnect the cable to phone, try instructions above again.


Using Visual Studio (Windows) 2022

Personally, I always FIRST get the phone|tablet recognized using XCode, connecting it to Mac. See instructions above.

Then:

  • Connect device to PC.
  • Automatic Provisioning is found in YourApp.iOS / Properties / iOS Bundle Signing.
  • Select Team.

if it works => "Automatic provisioning completed successfully."


OPTIONAL:

  • Disconnect device from PC, connect it to Mac - should be listed under "Remote Devices" in VS on Windows.

TBD: Not sure why I failed to get it to be listed as a Local Device, when it was attached to PC.

Solution 2:[2]

I had the same issue in a Xamarin.iOS project. I found a workaround. The reason was the update from Xamarin.Swift4 package 4.0.0.1 to 4.0.0.2.

After I downgraded back to 4.0.0.1 the issue no more exist.

I created an issue report at github: https://github.com/Flash3001/Xamarin.SwiftSupport/issues/25

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Ph.Homann