expo / eas-cli

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

eas credentials or eas build --platform iOS => Login to apple account, invalid session #2458

Closed ozziedev closed 1 day ago

ozziedev commented 1 month ago

Build/Submit details page URL

No response

Summary

Trying to do either an eas credentials to reset my iOS credentials, or any kind of eas build --platform ios build. The outcome is:

Authentication with Apple Developer Portal failed!
Invalid session.

Managed or bare?

Managed

Environment

npx expo-env-info

expo-env-info 1.2.0 environment info: System: OS: macOS 14.5 Shell: 5.9 - /bin/zsh Binaries: Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm Watchman: 2024.04.22.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 23.5, iOS 17.5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5 IDEs: Android Studio: 2023.3 AI-233.14808.21.2331.11709847 Xcode: 15.4/15F31d - /usr/bin/xcodebuild npmPackages: expo: ~51.0.20 => 51.0.20 react: 18.2.0 => 18.2.0 react-native: 0.74.3 => 0.74.3 npmGlobalPackages: eas-cli: 9.2.0 Expo Workflow: bare

npx expo-doctor

✔ Check Expo config for common issues ✔ Check package.json for common issues ✔ Check native tooling versions ✔ Check dependencies for packages that should not be installed directly ✔ Check for common project setup issues ✔ Check npm/ yarn versions ✔ Check for issues with metro config ✔ Check Expo config (app.json/ app.config.js) schema ✔ Check for legacy global CLI installed locally ✔ Check that native modules do not use incompatible support packages ✔ Check that packages match versions required by installed Expo SDK ✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

Error output

<machine> % EXPO_DEBUG=true eas build --platform ios
★ eas-cli@10.1.1 is now available.
To upgrade, run npm install -g eas-cli.
Proceeding with outdated version.

Loaded "env" configuration for the "production" profile: no environment variables specified. Learn more
Error: Cannot find module 'expo-dev-client/package.json'
Require stack:
- /Users/developer/source/project-name/project-name-dir/noop.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at resolveFileName (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/resolve-from/index.js:29:39)
    at resolveFrom (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/resolve-from/index.js:43:9)
    at module.exports (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/resolve-from/index.js:46:47)
    at isExpoDevClientInstalledAsync (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/build/build/utils/devClient.js:77:36)
    at ensureExpoDevClientInstalledForDevClientBuildsAsync (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/build/build/utils/devClient.js:17:15)
    at runBuildAndSubmitAsync (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/build/build/runBuildAndSubmit.js:82:79)
    at async Build.runAsync (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/build/commands/build/index.js:42:9)
    at async Build._run (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@oclif/core/lib/command.js:80:22)
    at async Config.runCommand (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@oclif/core/lib/config/config.js:301:25) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/developer/source/project-name/project-name-dir/noop.js'
  ]
}
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 ➜ withScheme ➜ 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 ➜ withIosUserInterfaceStyle ➜ withInfoPlist
ios.infoPlist: withFallback ➜ withPlugins ➜ withStaticPlugin ➜ withIosRootViewBackgroundColor ➜ withInfoPlist
ios.infoPlist: withFallback ➜ withPlugins ➜ withStaticPlugin ➜ withIosAdMob ➜ withInfoPlist
ios.infoPlist: withFallback ➜ withPlugins ➜ withStaticPlugin ➜ withMaps ➜ withGoogleMapsKey ➜ withInfoPlist
ios.infoPlist: withStaticPlugin ➜ withRunOnce ➜ withSecureStore ➜ withIosPermissions ➜ withInfoPlist
ios.entitlements: withIntrospectionBaseMods ➜ withIosBaseMods ➜ withGeneratedBaseMods ➜ withIosEntitlementsBaseMod
ios.entitlements: withIosExpoPlugins ➜ withPlugins ➜ withStaticPlugin ➜ withAssociatedDomains ➜ withEntitlementsPlist
ios.entitlements: withFallback ➜ withPlugins ➜ withStaticPlugin ➜ withNotificationsEntitlement ➜ withEntitlementsPlist
ios.entitlements: withStaticPlugin ➜ withExpoContacts ➜ withRunOnce ➜ withAccessesContactNotes ➜ withEntitlementsPlist
ios.entitlements: withStaticPlugin ➜ withExpoAppleAuthentication ➜ withRunOnce ➜ withAppleSignInWarning ➜ withEntitlementsPlist
ios.expoPlist: withIntrospectionBaseMods ➜ withIosBaseMods ➜ withGeneratedBaseMods ➜ withIosExpoPlistBaseMod
ios.expoPlist: withStaticPlugin ➜ withRunOnce ➜ withUnversionedUpdates ➜ withUpdates ➜ withExpoPlist
ios.splashScreenStoryboard: withPlugins ➜ withStaticPlugin ➜ withIosSplashScreenStoryboardBaseMod ➜ withGeneratedBaseMods ➜ withIosSplashScreenStoryboardBaseMod
ios.splashScreenStoryboard: withStaticPlugin ➜ withIosSplashScreen ➜ withPlugins ➜ withStaticPlugin ➜ withIosSplashScreenImage ➜ withIosSplashScreenStoryboard
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 missing 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: … admin@project.com
› Using password for admin@project.com from your local Keychain
  Learn more
✔ Logged in, verify your Apple account to continue
Two-step Verification (4 digit code) is enabled for 'admin@project.com'. Learn more: https://support.apple.com/en-us/HT204152

Please select a trusted device to verify your identity

✔ Please enter the 4 digit code … 1234
✔ Valid code
✖ Logging in...
Authentication with Apple Developer Portal failed!
Invalid session.
p [Error]: Invalid session.
    at a (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:712044)
    at o (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:711999)
    at t.idmsaRequestAsync (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:712258)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async headers (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:730356)
    at async t.storeSessionAsync (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:730322)
    at async g (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:721624)
    at async t.handleTwoFactorAuthentication (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:722595)
    at async Object.S [as loginWithUserCredentialsAsync] (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/node_modules/@expo/apple-utils/build/index.js:1:703487)
    at async loginWithUserCredentialsAsync (/Users/developer/.nvm/versions/node/v20.12.2/lib/node_modules/eas-cli/build/credentials/ios/appstore/authenticate.js:84:24) {
  data: {
    code: '-20528',
    message: 'Invalid session.',
    suppressDismissal: false
  },
  code: '-20528',
  title: undefined,
  suppressDismissal: false
}
    Error: build command failed.

Reproducible demo or steps to reproduce from a blank project

This issue doesn't appear to be a code related one, but auth.

1 Tried clearing all credentials under Project => Credentials in expo web portal 2 Removed usage of credentials.json

Cannot find anything else in the documentation that highlights this.

ozziedev commented 1 month ago

Note: I have also tried upgrading to eas-cli@10.1.11 with the same result as I had seem some peoples issues resolved with trying different cli version.s

szdziedzic commented 1 month ago

Can you try to delete the contents of the ~/.app-store/ directory?

dodyeid commented 1 month ago

Im having a similar urgent issue with "Authentication with Apple Developer Portal failed! unable to get local issuer certificate" after running eas credentials or eas build and logging into apple account.

My distribution certificate expired so I am trying to generate a new one, but I cant even get to those options because it seems it's checking for a local issuer certificate before I even have one? Ive tried clearing and deleting everything (.app-store, .expo, eas.json) all to no avail - running the latest version of eas cli too.

This is super frustrating! No clue how to proceed. Thanks for your help.

github-actions[bot] commented 1 week 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.

github-actions[bot] commented 1 day ago

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.