React native 如何编译本地android?

React native 如何编译本地android?,react-native,react-native-android,React Native,React Native Android,我已经创建了一个react原生应用程序。我是按照官方“React”网站的指示做的。但是我的本地android项目不会启动。 控制台: 我该怎么办?我在驱动器D上安装了android sdk,在驱动器C上安装了jdk。正因为如此,一切都不起作用。我已经重新安装了android studio、sdk和jdk。一切正常。您是否运行了npm安装?我认为您没有正确设置路径。在不同的驱动器上保留两件东西绝对没有问题。 info Running jetifier to migrate libraries to

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


我该怎么办?

我在驱动器D上安装了android sdk,在驱动器C上安装了jdk。正因为如此,一切都不起作用。我已经重新安装了android studio、sdk和jdk。一切正常。

您是否运行了
npm安装
?我认为您没有正确设置路径。在不同的驱动器上保留两件东西绝对没有问题。
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