question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot build Android under expo SDK 37

See original GitHub issue

After upgrading to expo SDK 37, I can no longer build for android. I’m using RN 0.61:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/user/projects/testapp/node_modules/react-native-reanimated/android/build.gradle' line: 89

* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/user/projects/testapp/android/local.properties'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/user/projects/testapp/node_modules/react-native-reanimated/android/build.gradle' line: 89

* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/user/projects/testapp/android/local.properties'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

    at checkExecSyncError (child_process.js:603:11)
    at execFileSync (child_process.js:621:15)
    at runOnAllDevices (/Users/user/projects/testapp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
    at buildAndRun (/Users/user/projects/testapp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:179:41)
    at /Users/user/projects/testapp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:133:12
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Command.handleAction (/Users/user/projects/testapp/node_modules/@react-native-community/cli/build/index.js:182:9)

I tried adding the local.properties file along with the sdk.dir path but that did not work either. Any help would be much appreciated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jcohenhocommented, Apr 4, 2020

My environment variable config for ANDROID_SDK_ROOT and other variables somehow got corrupted when installing an unrelated app. Fixed the env vars and now the Android build works. Thanks so much!

0reactions
Looskiecommented, Jul 31, 2021

???

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo 45 build fail on Android with EAS
I've upgraded the SDK version to 45 recently. Everything works well except it doesn't build either on Android or IO.
Read more >
Expo build android failed React native - Stack Overflow
I am not able to generate the internal apk since the expo SDK 47 update occurred, I get an error installing dependencies on...
Read more >
expo-updates - npm
expo -updates. expo-updates fetches and manages updates to your app stored on a remote server. API documentation.
Read more >
Expo SDK 41 - DEV Community ‍ ‍
If you built a standalone app previously, remember that you'll need to create a new build in order to update the SDK version....
Read more >
Being free from “expo” in React Native apps - Medium
Could not get unknown property 'mergeResourcesProvider' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl. But I have the solution ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found