首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何编译react-native android?

如何编译react-native android?
EN

Stack Overflow用户
提问于 2020-11-13 16:24:24
回答 1查看 82关注 0票数 0

我已经创建了一个react原生应用程序。我是按照"React“官方网站的指示做的。但是我的react原生android项目无法启动。控制台:

代码语言:javascript
运行
复制
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1289 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\Кирилл\Desktop\helloWorld\MyReactNative\node_modules\@react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\Кирилл\Desktop\helloWorld\MyReactNative\node_modules\@react-native-community\cli\build\bin.js, config]' command failed.

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\������\Desktop\helloWorld\MyReactNative\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 195

* What went wrong:
A problem occurred evaluating script.
> node:internal/modules/cjs/loader:903  throw err;  ^Error: Cannot find module 'C:\Users\Кирилл\Desktop\helloWorld\MyReactNative\node_modules\@react-native-community\cli\build\bin.js'    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15)    at Function.Module._load (node:internal/modules/cjs/loader:745:27)    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:72:12)    at node:internal/main/run_main_module:17:47 {  code: 'MODULE_NOT_FOUND',  requireStack: []}

* 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 9s

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
:ReactNative:Unexpected empty result of running '[node, C:\Users\Кирилл\Desktop\helloWorld\MyReactNative\node_modules\@react-native-community\cli\build\bin.js, config]' command.
npm ERR! code 1
npm ERR! path C:\Users\Кирилл\Desktop\helloWorld\MyReactNative
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "react-native run-android"

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Кирилл\AppData\Local\npm-cache\_logs\2020-11-13T08_19_01_474Z-debug.log

我该怎么办?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-13 22:33:56

我在驱动器D上安装了android sdk,在驱动器C上安装了jdk。正因为如此,一切都无法正常工作。我已经重装了android studio、sdk和jdk。一切都成功了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64817596

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档