expo-cli icon indicating copy to clipboard operation
expo-cli copied to clipboard

You must set the --apple-id flag and set the EXPO_APPLE_PASSWORD environment variable

Open trexpert opened this issue 6 years ago • 13 comments

Description

expo build:ios can not be used due to lack of apple username and password even if the requested credentials are provided by arguments and enviroment variables.

Command to run:

npx expo build:ios --non-interactive --release-channel $channel --apple-id $EXPO_APPLE_USERNAME --team-id $EXPO_APPLE_TEAM_ID --dist-p12-path $EXPO_APPLE_P12_PATH --push-id $EXPO_APPLE_PUSH_KEY --push-p8-path $EXPO_APPLE_P8_PATH --provisioning-profile-path $EXPO_APPLE_PROV_PATH

Expected Behavior

It should use the appleId i provide within the arguments and it should use the provided apple password i provide by enviroment variable...

Observed Behavior

[15:27:10] Error: In order to provide your Apple ID credentials, you must set the --apple-id flag and set the EXPO_APPLE_PASSWORD environment variable.
    at _getAppleIdFromParams (/Users/[MASKED]/builds/jE3FMv-H/0/[MASKED]/[####]/node_modules/expo-cli/src/appleApi/authenticate.ts:77:11)
    at _requestAppleIdCreds (/Users/[MASKED]/builds/jE3FMv-H/0/[MASKED]/[####]/node_modules/expo-cli/src/appleApi/authenticate.ts:64:10)
    at authenticate (/Users/[MASKED]/builds/jE3FMv-H/0/[MASKED]/[####]/node_modules/expo-cli/src/appleApi/authenticate.ts:44:46)
    at Context.ensureAppleCtx (/Users/[MASKED]/builds/jE3FMv-H/0/[MASKED]/[####]/node_modules/expo-cli/src/credentials/context.ts:72:30)
    at IOSBuilder.bestEffortAppleCtx (/Users/[MASKED]/builds/jE3FMv-H/0/[MASKED]/[####]/node_modules/expo-cli/src/commands/build/ios/IOSBuilder.ts:87:24)
    at IOSBuilder.prepareCredentials (/Users/[MASKED]/builds/jE3FMv-H/0/[MASKED]/[####]/node_modules/expo-cli/src/commands/build/ios/IOSBuilder.ts:221:16)
    at IOSBuilder.run (/Users/[MASKED]/builds/jE3FMv-H/0/[MASKED]/[####]/node_modules/expo-cli/src/commands/build/ios/IOSBuilder.ts:60:7)
    at IOSBuilder.command (/Users/[MASKED]/builds/jE3FMv-H/0/[MASKED]/[####]/node_modules/expo-cli/src/commands/build/BaseBuilder.ts:46:7)
    at Command.<anonymous> (/Users/[MASKED]/builds/jE3FMv-H/0/[MASKED]/[####]/node_modules/expo-cli/src/exp.ts:80:7)

Environment

  Expo CLI 3.21.13 environment info:
    System:
      OS: macOS 10.15.5
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 12.18.2 - ~/.nvm/versions/node/v12.18.2/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.14.5 - ~/.nvm/versions/node/v12.18.2/bin/npm
    IDEs:
      Xcode: /undefined - /usr/bin/xcodebuild
    npmPackages:
      expo: ^37.0.0 => 37.0.12 
      react: 16.9.0 => 16.9.0 
      react-dom: 16.9.0 => 16.9.0 
      react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4 
      react-native-web: ^0.11.7 => 0.11.7 

Reproducible Demo

No Demo

trexpert avatar Jul 06 '20 13:07 trexpert

Are you sure you have the correct env variable set? Unfortunately it can be a little confusing since there are two different env vars for the password, depending on the command you're running - https://github.com/expo/expo-cli/issues/2280

cruzach avatar Jul 09 '20 19:07 cruzach

Something is wrong.

It suddenly stopped working, it must be an expo-cli update causing the issue.

I have the same issue, it was working fine weeks ago.

karimcambridge avatar Jul 10 '20 02:07 karimcambridge

PR linked above #2394 I implemented without attempting to reproduce that issue and it appears that it's unnecessary.

I was unable to reproduce the issue you mentioned and looking at the code that throws an exception I don't see how it could fail (that part is very simple reading env and simple if check).

wkozyra95 avatar Jul 27 '20 09:07 wkozyra95

This problem is still not solved. if i run the expo build:ios command with 3.13.1 it takes the credential i provide by --apple-id and $EXPO_APPLE_PASSWORD and is just working fine. With the current version i always get the message that i have to provide those information... This is really annoying

trexpert avatar Sep 11 '20 15:09 trexpert

I have added some debug output. It looks like when using zsh it's not using the exported environment variables... none of them... with expo cli 3.13.1 this definitly works.

Edited: Here some more information about what i do: i read an environment file from folder with source ./path/to/file if i use echo $EXPO_APPLE_PASSWORD it prints my password if i start npx expo build:ios all those enviroment variables seems to be gone

trexpert avatar Sep 11 '20 15:09 trexpert

I have added the following line to my CI/CD script: export EXPO_APPLE_PASSWORD=$EXPO_APPLE_PASSWORD now this enviroment var is passed to the bash context i guess -.-

Cant get the difference to 3.13.1 where everything has been working fine... in 3.13 enviroment vars are passed

trexpert avatar Sep 11 '20 16:09 trexpert

how to set the $EXPO_APPLE_PASSWORD as environment variable?

tylerthedeveloper avatar Dec 03 '20 03:12 tylerthedeveloper

@tylerthedeveloper - you should look up how to do that on your operating system. if you're using windows, it's different than macos/linux

brentvatne avatar Dec 03 '20 03:12 brentvatne

@brentvatne I had it working and then a build a few days later it stopped, is there any caching issue? I have confirmed the env variable is still there

tylerthedeveloper avatar Dec 05 '20 22:12 tylerthedeveloper

not really sure what's going on in your case, can you create an issue and provide more info?

brentvatne avatar Dec 05 '20 22:12 brentvatne

@brentvatne unfortunately i didnt change anything, here is my from my package.json scripts: { "ebi": "expo build:ios -t archive --apple-id *****@gmail.com --team-id ******", } and i have confirmed when i do echo $EXPO_APPLE_PASSWORD it prints my password

tylerthedeveloper avatar Dec 09 '20 21:12 tylerthedeveloper

@tylerthedeveloper - can you create an issue?

brentvatne avatar Dec 09 '20 21:12 brentvatne

@brentvatne see above - https://github.com/expo/expo-cli/issues/3012

tylerthedeveloper avatar Dec 09 '20 22:12 tylerthedeveloper