首页 > 解决方案 > npm run android 在 NDK 工具链中找不到工具链

问题描述

帮助!!...我无法使用 运行新生成的 react 本机应用程序npm run android,我已经尝试了以下操作:/gradlew clean确保模拟器已启动并运行,我还尝试安装 ndk,但我不确定如何我应该选择它。

 ✘ 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

标签: androidnode.jsreact-nativeandroid-ndk

解决方案


尝试安装 Android NDK。应该有明确的说明如何为您的平台执行此操作。然后将具有以'arm-linux-androideabi'开头的好名称的可执行文件的目录放在你的PATH中。确保您可以运行“arm-linux-androideabi-gcc”或您在“bin”目录中找到的任何其他内容。然后尝试查看您的“npm”构建命令是否继续执行。


推荐阅读