0

I have a react native app. as of the last update theres now an app extension assocaited with it. freshly created parent app provisioning profiles/certificates have been generated. the correct entitlements have been confirmed both in the apple dev portal as well as in the .entitlements file. the app group has been added correctly. the extension also has the appropriate adhoc profile and certificate associated with it.

the app has no build/install issues in the debug variant, which is automatically signed.

the app has no build/install issues for the staging/release variant when automatically signed.

Im trying to build and install the release variant

however, when the app is signed manually (which i need to do in xcode to confirm there are no issues to debug my distribution issue through microsoft appcenter), the app builds fine but will not install on the device. i get the "App not installed" error.

opening the issue it says:

"The executable was signed with invalid entitlements". the code is -402620394.also: Domain: com.apple.dt.MobileDeviceErrorDomain, if thats helpful. theres no other information other tha stacktrace that doesnt appear too specific

Other info:

  • i have an APS certificate that says its expired in my keychain access, but when i checked the apple dev portal, its still not expired.
  • the release/staging variant will run on a simulator, but not on a physical device

Things ive tried:

  • restarting xcode
  • clearing derived data
  • deleting app from device
  • changing to legacy build system
  • confirmed the correct adhoc profiles and certficates for parent app and extension
  • recreated profiles/certificate again to be sure
  • confirmed the certificate from the provisioning profile matches the correct certificate
  • confirmed the development team for the app target, tests target and app extension are matching
  • confirmed my device UDID is added to both provisioning profiles
  • cleaning and building
  • changing the APS environment value to 'production' in the .entitlements file

some screenshots:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Please dont suggest to use automatic signing. i cant for reasons stated above. i have to manually set the provisioning profile and .p12 certificate for the parent app and the provisioning profile for the app extension in my distribution tool (appcenter)

Any advice?

Jim
  • 1,988
  • 6
  • 34
  • 68
  • Code signing does’t do anything for sims. They only work on physical devices. I’d remove any existing provisioning profiles from the mac just to be sure. Aside from that, are you trying to install a ‘release’ build from Xcode into your iPhone? ie are you using your App store / distribution cert and provisioning profiles? – mfaani Mar 14 '21 at 22:39
  • @Honey yes im trying to install a release build. why are you suggesting to "remove provisioning profiles from the mac"? what does that even mean – Jim Mar 14 '21 at 23:39
  • So yeah you can't test a release build like that. See my answer. So you shouldn't have a provisioning profile issue. But sometimes your Mac/Xcode gets confused on which profile it should choose, I know you said you're doing manual, so it would have been safe to remove all profiles to just be sure. But again that's not your problem. The issue is that you can't install apps signed with app store certification – mfaani Mar 15 '21 at 02:35
  • FYI you shouldn't need to change the aps environment. That gets fixed by itself. Did you try inspecting the entitlements from the binary? – mfaani Mar 15 '21 at 14:37
  • Also what is the deployment version on both the parent app and app extension? Make sure the min deployment version isn't above your iPhones OS version. Additionally your APS cert being expired or not won't cause any installation issues. – mfaani Mar 15 '21 at 14:41

1 Answers1

0

See here and here

In summary you can't ever install apps with App Store Distribution Certification directly into your phone. Only Apple can install apps signed with App Store Certificate.

If you want test out things, then either you test things in test flight and or you inspect the entitlements of the binary. You can do that following the instructions from dev forums here:

Check the Built Binary

The first step in debugging code signing entitlement problems is to check the actual entitlements of the binary. Xcode’s process for setting entitlements is quite complex, and it depends on various inputs, so it’s important to start by checking the output rather than looking at just the inputs.

To check the entitlements in your binary run the following command:

$ codesign -d --entitlements :- NetworkExtensionSample.app
Executable=…/NetworkExtensionSample.app/NetworkExtensionSample
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" …>
<plist version="1.0">
<dict>
    <key>application-identifier</key>
    <string>SKMME9E2Y8.com.example.apple-samplecode.NetworkExtensionSample</string>
    <key>com.apple.developer.networking.vpn.api</key>
    <array>
        <string>allow-vpn</string>
    </array>
    <key>com.apple.developer.team-identifier</key>
    <string>SKMME9E2Y8</string>
    <key>get-task-allow</key>
    <true/>
</dict>
</plist>
mfaani
  • 33,269
  • 19
  • 164
  • 293
  • Im not trying to install on my phone signed with an App Store Dist cert. its an "Apple distribution" cert, which has worked in the past both on my phone and in app center – Jim Mar 15 '21 at 13:41
  • Ah my bad. I missed that part. And have you trusted the developer cert? Did you try with a different phone? – mfaani Mar 15 '21 at 14:36