I have an error when I run the expo run:android command for it to run my project...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
Could not create task ':app:lint'.
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
Related
Working fine with android but build failed on iOS with error :
error: /Users/Aftab/repos/mobile/node_modules/#ant-design/icons-react-native/fonts/antoutline.ttf: No such file or directory (in target 'CareerPaths' from project 'CareerPaths')
I have created my first React Native (Android Wear OS) project and I cannot build it.
I don't understand why the path is linked twice. Can someone help me, please?
rnv run -p androidwear - ERRROR! COMMAND:
gradlew.bat assembleDebug -x bundleReleaseJsAndAssets
FAILED with ERROR:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
The SDK directory 'C:\Users\Dado\Desktop\mojaprva\platformBuilds\helloWorld_androidwear\Users\Dado\AppData\Local\Android\sdk' does not exist.
After updating react-native version 0.60.3 to 0.60.4, I am not able to build apk every time run the "react-native run-android" command an error message appears
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Front_End\android\app\build.gradle' line: 161
* What went wrong:
A problem occurred evaluating project ':app'.
> Project with path '../node_modules/react-native-code-push/android'
could not be found in project ':app'.
I have checked inside node_modules this module is present.
I am trying to run the react-native run-android command in window 10. I set up the path to the SDK folder using ANDROID_HOME in System Variables of Environment Variables
ANDROID_HOME | C:\Users\owner\AppData\Local\Android\Sdk
And I also set up sdk.dir in the local.properties file
sdk.dir=C\:\\Users\\owner\\AppData\\Local\\Android\\Sdk
However, when I run the command lines
react-native run-android
in my project folder C:\Users\owner\Documents\React_Native\MyApplication> It gave me an exception as follow.
C:\Users\owner\Documents\React_Native\MyApplication>react-native run-android
Scanning folders for symlinks in C:\Users\owner\Documents\React_Native\MyApplication\node_modules (34ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
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.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 5.305 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
This question already has answers here:
React Native - java.lang.RuntimeException: SDK location not found. Define location with sdk.dir in the local.properties
(5 answers)
Closed 6 years ago.
When I execute react-native run-android in the terminal, I get the following:
JS server already running.
Running adb -s HT68X0201778 reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd
android && ./gradlew installDebug)... Failed to notify
ProjectEvaluationListener.afterEvaluate(), but primary configuration
failure takes precedence. java.lang.RuntimeException: SDK location not
found. Define location with sdk.dir in the local.properties file or
with an ANDROID_HOME environment variable.
FAILURE: Build failed with an exception.
Where: Build file '........./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.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I have already done the following: Installed the Android Studio 2.2.3. I checked the boxes in the installer that it said to on the RN website. I installed Marshmallow SDK, AVD, HAXM, and JDK 1.8. I added ANDROID_HOME to /.bashrc and even executed set ANDROID_HOME=~/Library/Android/sdk on the terminal. (I double-checked the path.) I am running on react-native-cli version 2.0.1. Operating system is Mac OS Sierra.
I'm not sure where to go from here. Any help would be appreciated.
Thanks! --Anthony
Create a file called local.properties and add it to the android folder and then define sdk.dir(The location of your android SDK directory) in my case it is:
NOTE: you do not need to include it in quotes.
sdk.dir = /home/kbuhiire/Android/Sdk
I changed the ANDROID_HOME path from ~/Library/Android/sdk to /Users/myusername/Library/Android/sdk. That did the trick. Refer to React Native android build failed. SDK location not found