expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
792 stars 82 forks source link

Failed to sync capabilities, There is a problem with the request entity - The bundle cannot be deleted. #740

Closed farzd closed 2 years ago

farzd commented 2 years ago

Summary

eas build, fails at

✖ Failed to sync capabilities com.xxx.app UnexpectedAppleResponse: There is a problem with the request entity - The bundle 'PTBR6W6F57' cannot be deleted. Delete all the Apps related to this bundle to proceed.

I have PushNotifications and Apple Sign In enabled in the apple dev portal. I cant seem to find the entitlements file, when i run

expo config --type introspect

i only have this

entitlements: { 'aps-environment': 'development' }

i cant seem to find the ios/**/*.entitlements re: https://docs.expo.dev/build-reference/ios-capabilities/ in fact where are the ios and android folders? everything is so streamlined, i've forgotten the basics. I assume build is failing because there is mismatch between capabilities on apple server and my local build config?

[is there any issue with building with 'expo build' and using that url when submitting with eas?] edit: i've done this and it worked?

Environment

EAS CLI 0.34.1 environment info: System: OS: macOS 11.3.1 Shell: 5.8 - /bin/zsh Binaries: Node: 14.3.0 - ~/.nvm/versions/node/v14.3.0/bin/node Yarn: 1.15.2 - /usr/local/bin/yarn npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm Utilities: Git: 2.30.1 - /usr/bin/git npmPackages: expo: ~41.0.1 => 41.0.1 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz => 0.63.2 react-native-web: ~0.13.12 => 0.13.18

Error output

✖ Failed to sync capabilities com.xxx.app UnexpectedAppleResponse: There is a problem with the request entity - The bundle 'PTBR6W6F57' cannot be deleted. Delete all the Apps related to this bundle to proceed.

Reproducible demo or steps to reproduce from a blank project

-

EvanBacon commented 2 years ago

You can disable the capability syncing with EXPO_NO_CAPABILITY_SYNC=1 eas build and setup the capabilities manually through the apple developer portal.

From the doc you linked:

In managed workflow, the entitlements are read from the introspected Expo config. You can see what your introspected config looks like by running `expo config --type introspect in your project, then look for the ios.entitlements object for the results.

In managed workflow (when the ios folder does not exist), we generate one in memory using expo config --type introspect and read from that.

The error message:

UnexpectedAppleResponse: There is a problem with the request entity - The bundle 'PTBR6W6F57' cannot be deleted. Delete all the Apps related to this bundle to proceed.

Appears to come from Apple, per usual it looks like some less than useful advice that asks you to nuke your entitlements. We can attempt to intercept this error message and add more useful info (like whatever PTBR6W6F57 maps to), but first we need more information.

Please provide the following information so I can attempt to repro:

farzd commented 2 years ago

EXPO_DEBUG=1 EXPO_APP_STORE_DEBUG=1 eas build -p ios

★ eas-cli@0.36.1 is now available, please upgrade.
Proceeding with outdated version

-- Enabled debug logging --
Error: Cannot find module 'expo-dev-client/package.json'
Require stack:
- /Users/farz/Documents/ADclient/noop.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
    at resolveFileName (/Users/farz/.config/yarn/global/node_modules/resolve-from/index.js:29:39)
    at resolveFrom (/Users/farz/.config/yarn/global/node_modules/resolve-from/index.js:43:9)
    at module.exports (/Users/farz/.config/yarn/global/node_modules/resolve-from/index.js:46:47)
    at isExpoDevClientInstalledAsync (/Users/farz/.config/yarn/global/node_modules/eas-cli/build/build/utils/devClient.js:68:36)
    at ensureExpoDevClientInstalledForDevClientBuildsAsync (/Users/farz/.config/yarn/global/node_modules/eas-cli/build/build/utils/devClient.js:18:15)
    at Build.runAsync (/Users/farz/.config/yarn/global/node_modules/eas-cli/build/commands/build/index.js:65:83)
    at async Build._run (/Users/farz/.config/yarn/global/node_modules/@oclif/command/lib/command.js:43:20)
    at async Config.runCommand (/Users/farz/.config/yarn/global/node_modules/@oclif/config/lib/config.js:173:24)
    at async Main.run (/Users/farz/.config/yarn/global/node_modules/@oclif/command/lib/main.js:27:9) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/Users/farz/Documents/ADclient/noop.js' ]
}
- Linking to project @xxxltd/App
✔ Linked to project @xxxltd/App (​https://expo.dev/accounts/xxxltd/projects/App)
ios.infoPlist: withIntrospectionBaseMods ➜ withIosBaseMods ➜ withGeneratedBaseMods ➜ withIosInfoPlistBaseMod
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withVersion ➜ withInfoPlist
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withBuildNumber ➜ withInfoPlist
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withUsesNonExemptEncryption ➜ withInfoPlist
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withUserInterfaceStyle ➜ withInfoPlist
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withScheme ➜ withInfoPlist
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withRootViewBackgroundColor ➜ withInfoPlist
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withRequiresFullScreen ➜ withInfoPlist
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withOrientation ➜ withInfoPlist
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withDisplayName ➜ withInfoPlist
ios.infoPlist: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withGoogle ➜ withInfoPlist
ios.infoPlist: withStaticPlugin ➜ withIosSplashScreen ➜ withPlugins ➜ withStaticPlugin ➜ withIosSplashInfoPlist ➜ withInfoPlist
ios.infoPlist: withFallback ➜ withPlugins ➜ withStaticPlugin ➜ withIosFacebook ➜ withInfoPlist
ios.infoPlist: withFallback ➜ withPlugins ➜ withStaticPlugin ➜ withIosBranch ➜ withInfoPlist
ios.infoPlist: withFallback ➜ withPlugins ➜ withStaticPlugin ➜ withIosAdMob ➜ withInfoPlist
ios.infoPlist: withFallback ➜ withPlugins ➜ withStaticPlugin ➜ withMaps ➜ withGoogleMapsKey ➜ withInfoPlist
ios.entitlements: withIntrospectionBaseMods ➜ withIosBaseMods ➜ withGeneratedBaseMods ➜ withIosEntitlementsBaseMod
ios.entitlements: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withAssociatedDomains ➜ withEntitlementsPlist
ios.entitlements: withExpoNotifications ➜ withStaticPlugin ➜ withRunOnce ➜ withNotifications ➜ withNotificationsIOS ➜ withEntitlementsPlist
ios.entitlements: withStaticPlugin ➜ withExpoContacts ➜ withStaticPlugin ➜ withRunOnce ➜ withAccessesContactNotes ➜ withEntitlementsPlist
ios.entitlements: withStaticPlugin ➜ withExpoAppleAuthentication ➜ withStaticPlugin ➜ withRunOnce ➜ withAppleSignInEntitlement ➜ withEntitlementsPlist
ios.expoPlist: withIntrospectionBaseMods ➜ withIosBaseMods ➜ withGeneratedBaseMods ➜ withIosExpoPlistBaseMod
ios.expoPlist: withStaticPlugin ➜ withRunOnce ➜ withUnversionedUpdates ➜ withUpdates ➜ withExpoPlist
ios.podfileProperties: withIntrospectionBaseMods ➜ withIosBaseMods ➜ withGeneratedBaseMods ➜ withIosPodfilePropertiesBaseMod
ios.podfileProperties: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withJsEnginePodfileProps ➜ withPodfileProperties
✔ Using remote iOS credentials (Expo server)

If you provide your Apple account credentials we will be able to generate all necessary build credentials and fully validate them.
This is optional, but without Apple account access you will need to provide all the values manually and we can only run minimal validation on them.
✔ Do you want to log in to your Apple account? … yes

› Log in to your Apple Developer account to continue
✔ Apple ID: … xxx@xxx.xxx
› Restoring session /Users/farz/.app-store/auth/xxx@xxx.xxx/cookie
POST https://developer.apple.com/services-account/QH65B2/account/listTeams.action
200 OK (POST https://developer.apple.com/services-account/QH65B2/account/listTeams.action)
› Team xxxx Limited (TEAMID1234)
GET https://appstoreconnect.apple.com/olympus/v1/session
200 OK (GET https://appstoreconnect.apple.com/olympus/v1/session)
› Provider xxxx Limited (123563282)
✔ Logged in Local session
POST https://developer.apple.com/services-account/QH65B2/account/listTeams.action
200 OK (POST https://developer.apple.com/services-account/QH65B2/account/listTeams.action)
- Linking bundle identifier com.fakeidentifier.xxx
POST https://developer.apple.com/services-account/v1/bundleIds
- Linking bundle identifier com.fakeidentifier.xxx
200 OK (POST https://developer.apple.com/services-account/v1/bundleIds)
- Linking bundle identifier com.fakeidentifier.xxx
✔ Bundle identifier registered com.fakeidentifier.xxx
- Syncing capabilities
POST https://developer.apple.com/services-account/v1/bundleIds/PTBR6W6F57/bundleIdCapabilities
200 OK (POST https://developer.apple.com/services-account/v1/bundleIds/PTBR6W6F57/bundleIdCapabilities)
Current remote capabilities:
[
  {
    "context": {
      "providerId": 123563282,
      "teamId": "TEAMID1234"
    },
    "id": "PTxxxx_GAME_CENTER",
    "attributes": {
      "ownerType": "BUNDLE",
      "settings": [
        {
          "key": "GAME_CENTER_SETTING",
          "options": [
            {
              "key": "GAME_CENTER_IOS",
              "properties": [
                null
              ]
            }
          ]
        }
      ],
      "editable": true,
      "inputs": null,
      "enabled": true,
      "responseId": "xxxxx-xxx-xxx-xxxx-xxxx"
    }
  },
  {
    "context": {
      "providerId": 123563282,
      "teamId": "TEAMID1234"
    },
    "id": "PTxxxx_IN_APP_PURCHASE",
    "attributes": {
      "ownerType": "BUNDLE",
      "settings": null,
      "editable": true,
      "inputs": null,
      "enabled": true,
      "responseId": "6dfd3936-37ee-4978-967c-984ce1791a98"
    }
  },
  {
    "context": {
      "providerId": 123563282,
      "teamId": "TEAMID1234"
    },
    "id": "PTxxxx_PUSH_NOTIFICATIONS",
    "attributes": {
      "ownerType": "BUNDLE",
      "settings": null,
      "editable": true,
      "inputs": null,
      "enabled": true,
      "responseId": "6dfd3936-37ee-4978-967c-984ce1791a98"
    }
  },
  {
    "context": {
      "providerId": 123563282,
      "teamId": "TEAMID1234"
    },
    "id": "PTxxxx_APPLE_ID_AUTH",
    "attributes": {
      "ownerType": "BUNDLE",
      "settings": [
        {
          "key": "APPLE_ID_AUTH_APP_CONSENT",
          "options": [
            {
              "key": "PRIMARY_APP_CONSENT",
              "properties": [
                null
              ]
            }
          ]
        }
      ],
      "editable": true,
      "inputs": null,
      "enabled": true,
      "responseId": "6dfd3936-37ee-4978-967c-984ce1791a98"
    }
  }
]

Current local entitlements:
{
  "aps-environment": "development"
}
Skipping existing capability: aps-environment (Push Notifications)
Remaining to remove:  [
  'PTxxxx_GAME_CENTER',
  'PTxxxx_IN_APP_PURCHASE',
  'PTxxxx_APPLE_ID_AUTH'
]
Existing to disable:  [
  'PTxxxxGAME_CENTER',
  'PTxxxx_IN_APP_PURCHASE',
  'PTxxxx_APPLE_ID_AUTH'
]
PATCH https://developer.apple.com/services-account/v1/bundleIds/PTBR6W6F57
Error: Request failed with status code 409 (PATCH https://developer.apple.com/services-account/v1/bundleIds/PTBR6W6F57)
✖ Failed to sync capabilities com.fakeidentifier.xxx
    UnexpectedAppleResponse: There is a problem with the request entity - The 
    bundle 'PTBR6W6F57' cannot be deleted. Delete all the Apps related to this
     bundle to proceed.

_internal.modResults.ios.entitlements after running expo config --type introspect

 entitlements: {
      'aps-environment': 'development'
    }

Thanks for your help

EvanBacon commented 2 years ago

I'm. seeing that this error has occurred before and it appears to be related to the Apple Sign In capability. I'll attempt to repro locally.

farzd commented 2 years ago

thanks updated error


Failed to patch capabilities: [ { capabilityType: 'APPLE_ID_AUTH', option: 'OFF' } ]
✖ Failed to sync capabilities com.yy.xxx
    Error: Unexpected error occurred while attempting to update capabilities
    for app "com.yy.xxx".
    Capabilities can be modified manually in the Apple developer console at
    https://developer.apple.com/account/resources/identifiers/bundleId/edit/PT
    BR6W6F57.
    Auto capability syncing can be disabled with the environment variable
    `EXPO_NO_CAPABILITY_SYNC=1`.
    There is a problem with the request entity - The bundle 'PTxxx'
    cannot be deleted. Delete all the Apps related to this bundle to proceed.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/```
EvanBacon commented 2 years ago

@farzd this might simply be a bug with the Apple API. I'd recommend updating the capabilities manually and seeing if you get the same error in the web interface.

dsokal commented 2 years ago

@farzd any luck with the issue? Did you get the same error in the web interface?

farzd commented 2 years ago

Sorry guys, i haven't had a chance to check this out yet @dsokal

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

nicholascm commented 2 years ago

I saw this issue today locally when trying to use the steps recommended for the certificate expiration issue (https://status.expo.dev/incidents/cgrprcsr39zt) - happens every time for my interactive builds. I also have PushNotifications and Apple Sign in enabled for my app.

farzd commented 2 years ago

https://github.com/expo/eas-cli/issues/804#issuecomment-981918389

this worked for me

mfrfinbox commented 4 weeks ago

Just for anyone facing this issue with the capability [{ capabilityType: 'APPLE_ID_AUTH', option: 'OFF' }] what worked for me was to add usesAppleSignIn: true under ios in the app.config. Then I added "expo-apple-authentication" in the plugins (not sure if the latter did something). Good luck

farzd commented 4 weeks ago

@mfrfinbox yes, this a requirement mentioned in the docs https://docs.expo.dev/versions/latest/sdk/apple-authentication/#setup-ios-project