Skip to content

react-native run-android ; SDK location not found, but it exists in the path #21105

Closed
@AmirHMousavi

Description

@AmirHMousavi

I have installed Android 8.0 (Oreo) and the rest of the instructions. The only difference is that I have defined the path varibales in .bashrc and not .bash-profile. when I want to run my react-native application I face the Build failed with an exception.

the log looks like below:

Failure log

    sudo react-native run-android
    Starting JS server...
    Building and installing the app on the device (cd android && ./gradlew installDebug)...
    Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring project ':app'.
    > SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

the project built for me does not contain the local.properties. but I already have ANDROID_HOME in the Path.

Environment Variables

$ printenv | grep Android
 ANDROID_HOME=/home/amir/Android/Sdk
PATH=/home/amir/Android/Sdk/tools:/home/amir/Android/Sdk/tools/bin:/home/amir/Android/Sdk/platform-tools:/home/amir/Android/Sdk/emulator

Environment

  React Native Environment Info:
    System:
      OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
      CPU: x64 Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
      Memory: 684.43 MB / 11.61 GB
      Shell: 4.4.19 - /bin/bash
    Binaries:
      Node: 8.11.2 - /usr/bin/node
      Yarn: 1.9.4 - /usr/bin/yarn
      npm: 6.4.1 - /usr/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    npmPackages:
      react: 16.5.0 => 16.5.0 
      react-native: 0.57.0 => 0.57.0 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidAndroid applications.Platform: LinuxBuilding on Linux.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions