npm run android No toolchains found in the NDK toolchains - android

HELP!!... I can't run a newly generated react native app with npm run android, I already tried the following: /gradlew clean, made sure the emulator is up and running, I also tried to install the ndk, but I'm not sure how I'm supposed to select it.
✘ dio#pop-os  ~/Documents/Code/Beex-Travel/beexmobile   developing  npm run android
> beexmobile#0.0.1 android /home/dio/Documents/Code/Beex-Travel/beexmobile
> react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1096 file(s) to forward-jetify. Using 12 workers...
info JS server already running.
info Installing the app...
> Task :app:stripDebugDebugSymbols FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
25 actionable tasks: 2 executed, 23 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi
* 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 15s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! beexmobile#0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the beexmobile#0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dio/.npm/_logs/2021-03-15T08_03_34_370Z-debug.log

Try installing Android NDK. There should be clear instructions how to do this for your platform. Then put the directory where you have the executables that have the fine name starting with ’arm-linux-androideabi’ in your PATH. Make sure you can run ’arm-linux-androideabi-gcc’ or any other thing you find in the ’bin’ directory. Then try and see if your ’npm’ build command proceeds further.

Related

React Native - Could not determine the dependencies of task ':react-native-reanimated:generateJsonModelDebug'

I am facing this issue. Can anyone help me out? 
while running react native application. I am getting this error. I installed all the dependencies and software that were required even though I was getting this
> Configure project :react-native-reanimated
Native libs debug enabled: false
Android gradle plugin: 4.1.1
Gradle: 6.7.1
building Reanimated2
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':react-native-reanimated:generateJsonModelDebug'.
> CMake '3.18.1' was not found in PATH or by cmake.dir property.
* 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 8s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with
--verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! offket#0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
The new version of react-native-reanimated (v2.10.0) has this issue as discussed here and here. A PR has been created to fix this issue. So till a new version is released, you can try these workarounds -
Install CMake 3.18.1 using CLI or Android Studio.
CLI
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "cmake;3.18.1"
Android Studio
Go to Tools > SDK Manager > SDK Tools > Show Package Details and select CMake version 3.18.1 and Apply.
Rebuild the app. If it's still failing then downgrade the package to previous version and rebuild.
yarn add react-native-reanimated#2.9.1
OR
npm install react-native-reanimated#2.9.1

npx react-native run-android fails with error

i built a react native app and integrated it with firebase. it works fine in ios when i run with npx react-native run-ios. It even works in android if i open the project directly in android studio and run it. but when i run the command run-android i get the error below:
npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1153 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...
FAILURE: Build failed with an exception.
What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
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 932ms
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
npm ERR! code 1
npm ERR! path /Users/manishshukla/Documents/technical/mytestapp
npm ERR! command failed
npm ERR! command sh -c react-native run-android
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/manishshukla/.npm/_logs/2020-12-06T21_55_04_212Z-debug.log
basically gradle-6.3 did the trick. when i set up everything it was 6.2. in gradle-wrapper.properties i had to change 6.2 to 6.3 like this:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
try running npx react-native doctor in your project's directory terminal and when you got the error just press e inside your terminal and it will install/upgrade your files according to it

Error While Running Android Build On React Native

I have installed all necessary SDK , Platform Tools . I've the emulator open and running, adb added in PATH. Still this error isn't letting me through.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Launching emulator...
/bin/sh: adb: command not found
info Installing the app...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose
FAILURE: Build failed with an exception.flag for more details.
* What went wrong:
Could not determine the dependencies of task ':app:installDebug'.
> 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/manndave/IdeaProjects/MyFirstReactNative/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 3s
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081```
Please run the following from terminal, inside the project folder
export ANDROID_HOME=/Users/{yourusername}/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
Then npm run android
In my case, I had running Metro Bundler from another project. Closing it is solved my issue.

react-native program is not installed on the emulator

I created a new project with React Native in Windows 10 but it does not run with the run-android command.
I will summarize what I did because I think all the programs are installed:
I install both npm and node.
Java installation.
React installation.
In the Environment system, these are set.
ANDROID_HOME ---> C:\Users\IHC\AppData\Local\Android\Sdk
JAVA_HOME--> C:\Program Files\Java\jdk-۱۴.۰.۱
path--> C:\Users\IHC\AppData\Local\Android\Sdk\tools
C:\Users\IHC\AppData\Local\Android\Sdk\platform-tools
C:\Program Files\nodejs\
C:\Users\IHC\AppData\Local\Android\Sdk
C:\Users\IHC\AppData\Local\Android\Sdk\emulator
C:\Program Files\Java\jdk-۱۴.۰.۱\bin
The error is:
info Starting JS server...
info Installing the app...
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
.
.
.
.
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:832)
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
* 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 44s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
enter code here
Can you check on the android version installed, for latest version refer https://www.npmjs.com/package/#react-native-community/cli-platform-android and retry.
That is installed, well I did the following
remove jdk-۱۴.۰.۱ and i install jdk-8u261-windows-x64
first of all run Oracle VM VirtualBox next run Genymotion
and in powershell
npm start -- --reset-cache
npm install -g npm#4
react-native run-android

Problem running simulator and gradle in reactNative

I'm having trouble running the application inside the simulator
And gives the following error:
(I've tested on Genymotion and nox simulators)
none
C:\Users\Sajjad Alavi\Desktop\n\test1>npm run android
> # android C:\Users\Sajjad Alavi\Desktop\n\test1
> react-native run-android
info JS server already running.
info Building and installing the app on the device (cd android && gradlew.bat ap
p:installDebug)...
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Sajjad Alavi\Desktop\n\test1\android\app\build.gradle' line
: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : U
nsupported major.minor version 52.0
* 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
Deprecated Gradle features were used in this build, making it incompatible with
Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:com
mand_line_warnings
BUILD FAILED in 6s
error 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/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag
for more details.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # android script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sajjad Alavi\AppData\Roaming\npm-cache\_logs\2019-09-11T16
_13_49_689Z-debug.log
Seems you are using the wrong version of JDK. Check your JAVA_HOME to use JDK 1.8
you should go to
user >> program_data >> gradle
Delete the cache
then,run the program in android studio

Categories

Resources