Ad Hoc profile issue

10,206

Solution 1

This started happening after upgrading from XCode 6 to 8, and what resolved the problem was adding the following:

-exportProvisioningProfile "MyApp Ad Hoc Distribution Profile"

to my xcodebuild -exportArchive command line.

Solution 2

For me, this started to happen since Xcode 7.

I used to make AdHoc .ipa for over-the-air distribution via

xcodebuild -exportArchive -archivePath "/path/to/My App 9-24-15, 21.21.xcarchive" -exportPath /path/to/MyApp_AdHoc.ipa -exportFormat ipa -exportProvisioningProfile "MyApp Ad Hoc Distribution Profile"

(the .xcarchive made by Xcode)

Steps, how I fixed this:

  1. No longer using xcodebuild, but instead let Xcode do the .ipa for me via "Export..." command in the Organizer
  2. Set up Xcode to automatically manage my provisioning profiles
  3. From the doc above I made one exception: in target's Build Settings under Code Signing Identify I do specify iOS Developer for Debug builds and iOS Distribution for Release builds
  4. Close Xcode
  5. Refresh an App Store Provision Profile as described in The beta-reports-active Entitlement Technical Q&A, BUT before downloading the Provision Profile via Xcode (Step 9) I have removed it from here

    ~/Library/MobileDevice/Provisioning Profiles
    
  6. Remove DerivedData folder

    rm -rf ~/Library/Developer/Xcode/DerivedData/*
    
  7. Remove Xcode Cache (just in case)

    sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode
    
  8. Launch Xcode again
  9. Download the App Store Provision Profile via Preferences... -> Accounts
  10. Achieve
  11. Make sure when I "Export..." via Xcode there is NO beta-reports-active key under app's Entitlements (if you have one - that won't work for AdHoc builds)

Solution 3

For me beta-reports-active was the issue: https://developer.apple.com/library/ios/qa/qa1830/_index.html

I have two Xcode archives that I can export for ad-hoc distribution. AFAIK they are based on the same code and created the same way (Xcode>Product>Archive). During the export wizard one archive shows me "beta-reports-active" under entitlements the other doesn't. I get the same error message as the OP when trying to install the ipas with the "beta-reports-active" entitlement. I did recreate the provisioning profile and reinstalled the appstore distribution profile as well before archiving again which produced the archive without the "beta-reports-active" entitlement, but i'm not sure if that was the cause.

Share:
10,206
Admin
Author by

Admin

Updated on July 07, 2022

Comments

  • Admin
    Admin almost 2 years

    I have this error, is anyone know what is the problem? I check and I have Entitlements key in both adHoc and main provisioning profile but I do not know why I have this error

     DTFetchSymbols[512] <Notice>:   
     /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv7s
     DTFetchSymbols[512] <Notice>: kCommand_ListFilesPlist
     syslog_relay[377] <Notice>: syslog_relay found the ASL prompt. Starting...
     profiled[84] <Notice>: (Note ) MC: Provisioning profiles changed
     mobile_installation_proxy[375] <Warning>: LaunchServices: Please include the 
     kCFBundleIdentifierKey in the options dictionary when installing an app.
     mobile_installation_proxy[375] <Warning>: LaunchServices: installing app with unknown
      bundleID
     installd[384] <Notice>: 0x603000 -[MIClientConnection
     _doBackgroundInstallationForPath:withOptions:completion:]: Install of 
     "/var/mobile/Media/PublicStaging/Test.ipa" type Customer requested by  
     mobile_installation_proxy (pid 375)
     installd[384] <Notice>: 0x603000 -[MIInstaller performInstallationWithError:]: 
     Installing <MIInstallableBundle ID=test.testTest.Test; Version=3, ShortVersion=3.1.2>
     misagent[378] <Error>: attempt to install invalid profile: 0xe8008012
     installd[384] <Error>: 0x603000 -[MIInstallableBundle 
     _installEmbeddedProfileInBundle:]: Could not install embedded profile: 0xe8008012 
     (Unsupported device)
     installd[384] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
     installd[384] <Error>: entitlement 'beta-reports-active' has value not permitted by 
     provisioning profile 'test TEST AdHoc 2015'
     installd[384] <Error>: 0x603000 -[MICodeSigningVerifier performValidationWithError:]:
     186: Failed to verify code signature of <MIExecutableBundle : path =  /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.asUxKy/extracted/Payload/Test.app identifier = test.Test.testTest type = 4> : 0xe8008016 (Entitlements found that are not permitted by provisioning profile)
    
     installd[384] <Error>: 0x603000 -[MIInstaller performInstallationWithError:]: 
     Verification stage failed
     mobile_installation_proxy[375] <Error>: 0x603000 
    __MobileInstallationInstallForLaunchServices_block_invoke240: Returned error Error 
    Domain=MIInstallerErrorDomain Code=13 "Failed to verify code signature of 
    <MIExecutableBundle : path =     /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.asUxKy/extracted/Payload/Test.app identifier = test.Test.testTest type = 4> : 0xe8008016 (Entitlements found that are not permitted by provisioning profile)" UserInfo=0x17566950 {LibMISErrorNumber=-402620394, LegacyErrorString=ApplicationVerificationFailed, FunctionName=-[MICodeSigningVerifier performValidationWithError:], NSLocalizedDescription=Failed to verify code signature of <MIExecutableBundle : path = 
           /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.asUxKy/extracted/ Payload/Test.app identifier = test.Test.testTest type = 4> : 0xe8008016 (Entitlements found   that are not permitted by provisioning profile), SourceFileLine=186}
     mobile_installation_proxy[375] <Warning>: ERROR:    MobileInstallationInstallForLaunchServices returned nil
     mobile_installation_proxy[375] <Error>: 0x581000 handle_install: Installation failed:   Error Domain=LaunchServicesError Code=0 "The operation couldn’t be completed. (LaunchServicesError error 0.)" UserInfo=0x17566a30 {Error=ApplicationVerificationFailed, ErrorDetail=-402620394, ErrorDescription=Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.asUxKy/extracted/Payload/Test.app identifier = test.Test.testTest type = 4> : 0xe8008016 (Entitlements found that are not permitted by provisioning profile)}
    

    Thanks in advance!

  • Shady Elyaski
    Shady Elyaski over 9 years
    Can you please elaborate more in that?
  • dvkch
    dvkch over 9 years
    Still have this issue, and this is the exact same case: embedding a profile for APNS. I use shenzhen with my provisioning profile and my signing identity.
  • LoriHC
    LoriHC almost 9 years
    beta-reports-active doesn't indicate you're using a beta; it indicates that you can distribute your build using Apple's TestFlight if you want.