Reputation: 13
I am new to React Native. When I run the project using react-native run-android
in terminal, Build failed with an exception
error will display.
I set android_home
(sdk location) correctly:
Error detail
FAILURE: Build failed with an exception.
* Where:
Build file '/home/sugeivan/react/AwesomeProject/android/app/build.gradle' line: 110
* What went wrong:
A problem occurred evaluating project ':app'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Upvotes: 1
Views: 1432
Reputation: 37414
Build system need to know the exact location of SDK
on your system which contain platform specific tools and source code files to build the project.
seems like your android sdk path is not set in your OS and make sure you have SDK.
ANDROID_HOME
varibale or the sdk path is wrong
so to check this goto control panal=> system =>properties find environment variable option under advance tab and click on it
if not found
then you need to set the sdk location path in environment variables by adding a new variable as "ANDROID_HOME"
.you can do this in two ways
through terminal follow this link this will create new variable and add it to OS environment variables
and other way is
goto control panal=> system =>properties
find environment variable option under advance tab and click on it
create new under user variable
name will be ANDROID_HOME
and value will be "path to your sdk folder"
e.g C:\android\sdk
local.properties
filesdk.dir=C:\android\sdk
Upvotes: 1
Reputation: 1739
You should set the environment path as:
variable name: ANDROID_HOME
variable value: F:\android\android-sdk
You need to restart the Command Prompt (Windows) to apply the new environment variables.
variable value is your android sdk path.
you should also correctly set android studio sdk path by going to:
1. File
2. Settings
3. Android SDK-> Android SDK Location: F:\android\android-sdk
you should update your SDK libraries as mentioned by the react-native official documentation:
http://facebook.github.io/react-native/releases/0.27/docs/getting-started.html
Upvotes: 0