Expo-source build error in AS

Hey guys, I’m encountering an issue when trying to build my detached Expo project in AS. Was wondering if any else had encountered the same issue and had some insight on how to resolve it?

Project is freshly detached and running SDK15.

Here’s the error log:

Incremental java compilation is an incubating feature.
:app:buildInfoDebugLoader
:app:exponentPrebuildStep
./.expo-source/android/detach-scripts/prepare-detached-build.sh: line 4: exp: command not found

FAILED
:app:buildInfoGeneratorDebug

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:exponentPrebuildStep’.

Process ‘command ‘./.expo-source/android/detach-scripts/prepare-detached-build.sh’’ finished with non-zero exit value 127

looks like exp isn’t found, do you have it installed globally? if so, i guess your path isn’t properly set when executing that script

Once you install exp globally (npm install -g exp), you can set the path by running exp path

1 Like

I’m getting similar error running android studio with expo. In android studio I get an error about the command ‘exp’ is not a recognizable command and then I get this

  • What went wrong:
    Execution failed for task ‘:app:exponentPrebuildStep’.

Process ‘command ‘cmd’’ finished with non-zero exit value 1

All in my gradle console. I’ve already installed expo globally. I don’t know how to make this error go away.

@ajkhatibi i’m getting the exact same error . Did you find the solution ?

Yeah I just bought a windows machine and ran it on a windows, did a couple of configurations and it worked for me.

@ajkhatibi i am on windows :slight_smile: what kind of configurations did you do ? i’m not android expert. I think i just removed/unlinked react-native-keychain but i can’t redo this operation

@flieks @ajkhatibi @adamjnav
There was a bug in this commit please refer to my comment wrote in issue. Check if your issue is related to this issue.

https://github.com/expo/expo/commit/a0112d79cb6f4e83fba66fec284e2d0913f29249#diff-f97171d36fc7cecfadef79bee8be3ec0

I am still facing this issue, what did u guys do to manage working this? I am getting same error:
exponentPrebuildStep Error on android studio

@dooboolab @adamjnav have u guys been able to solve this on Ubuntu

@lulzimfazlija2
Sorry I’ve not tried this in ubuntu…
However, what you can try is just not to upgrade the gradle when android studio recommends you to update. Then you don’t have to do the above stuffs.

I’m on a Mac and for some reason Android Studio isn’t reading my PATH correctly. I solved this issue by changing line 3 of android/detach-scripts/prepare-detached-build.sh to:

value=/usr/local/bin

Cheers,
Alvaro