eas-cli: iOS build with expo-document-picker for internal distribution fails because of unsupported entitlement

Summary

In managed workflow on SDK 43 with expo-document-picker, fastlane fails in a profile having distribution: internal because of unsupported icloud-container-environment entitlement.

Environment

EAS CLI 0.32.0 environment info:
    System:
      OS: macOS 11.6
      Shell: 5.8 - /usr/local/bin/zsh
    Binaries:
      Node: 16.11.1 - /usr/local/opt/node/bin/node
      Yarn: 3.0.2 - ~/.npm-packages/bin/yarn
      npm: 8.0.0 - /usr/local/bin/npm
    Utilities:
      Git: 2.29.2 - /usr/local/bin/git
    npmPackages:
      expo: next => 43.0.0-beta.3
      expo-dev-client: ~0.6.2 => 0.6.2
      react: 17.0.1 => 17.0.1
      react-dom: 17.0.1 => 17.0.1
      react-native: 0.64.2 => 0.64.2
      react-native-web: 0.17.1 => 0.17.1
    npmGlobalPackages:
      eas-cli: 0.32.0
      expo-cli: 4.12.1

Error output

Error Domain=IDEFoundationErrorDomain Code=1 “exportOptionsPlist error for key “iCloudContainerEnvironment”: expected one of {Development, Production}, but no value was provided” UserInfo={NSLocalizedDescription=exportOptionsPlist error for key “iCloudContainerEnvironment”: expected one of {Development, Production}, but no value was provided}

It’s working without distribution: internal (I don’t know why?)

Reproducible demo or steps to reproduce from a blank project

What I’ve tried, with the same error :

  • Manually adding ios.entitlements entry with 'com.apple.developer.icloud-container-environment': 'Production' in app.config.js (seems ignored by EAS)
  • EXPO_NO_CAPABILITY_SYNC=1 eas build
  • EXPO_DEBUG=1 eas build says Skipping entitlement that is not supported by EAS: com.apple.developer.icloud-container-environment

This last step led me to https://github.com/expo/eas-cli/blob/1419ca6325268ab1bd3f45ed7fcf0a5985ac5552/packages/eas-cli/src/credentials/ios/appstore/bundleIdCapabilities.ts#L258 which doesn’t contain com.apple.developer.icloud-container-environment in CapabilityMapping definitions.

See entitlement details https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_icloud-container-environment

Here is a failing build https://expo.dev/accounts/dacotha/projects/imparato/builds/53aaae68-3e0f-4c78-86d7-757ccc8083e4

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 22 (3 by maintainers)

Most upvoted comments

What fixed it for me was adding iCloudContainerEnvironment to the expo-document-picker plugin parameters in app.json per this comment.

For example:

"plugins": [
      [
        "expo-document-picker",
        {
          "appleTeamId": TEAM_ID,
          "iCloudContainerEnvironment": "Production"
        }
      ]
],

What fixed it for me was adding iCloudContainerEnvironment to the expo-document-picker plugin parameters in app.json per this comment.

For example:

"plugins": [
      [
        "expo-document-picker",
        {
          "appleTeamId": TEAM_ID,
          "iCloudContainerEnvironment": "Production"
        }
      ]
],

It fixed the issue for me, thanks! Please update the documentation: https://docs.expo.dev/versions/latest/sdk/document-picker/

appleTeamId should not be included AFAIK reading the source

// app.config.ts
const environment = 'development'
...
'plugins': [
      [
        'expo-document-picker',
        {
          'iCloudContainerEnvironment': environment === 'production' ? 'Production' : 'Development'
        }
      ]
],
...

this is still happening for me with the latest eas-cli and latest expo-document-picker. can anyone assist?

Thank you, it works now

Same issue here with expo-document-picker 10.1.3

I am still seeing this issue. I am using SDK 44 and expo-document-picker 10.1.3.

this is still happening for me with the latest eas-cli and latest expo-document-picker. can anyone assist?

As I’ve understood from the other thread you linked, your issue has already been solved by now after updating?