![](/img/trans.png)
[英]Failed to install the app in android emulator in React Native
[英]Failed to install the app React Native VSCODE
我正在嘗試讓 npx react-native run-android 工作。 我嘗試通過 stackoverflow 進行搜索,但尚未找到有效的答案。 我試過使用 EXPO CLI,現在我使用 REACT NATIVE CLI 得到了相同的結果。 我只是想設置一個空白應用程序,所以我知道它可以工作。
Info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/7.5.1/userguide/gradle_daemon.html
Process command line: D:\JAVA\bin\java.exe -XX:MaxMetaspaceSize=512m -Xmx2048m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\Owner\.gradle\wrapper\dists\gradle-7.5.1-all\1ehga6e77gqps5uk2kc5kf1vc\gradle-7.5.1\lib\gradle-launcher-7.5.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.5.1
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
at makeError (D:\ReactNativeCLITutorial\MyNewsletter\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at D:\ReactNativeCLITutorial\MyNewsletter\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (D:\ReactNativeCLITutorial\MyNewsletter\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\ReactNativeCLITutorial\MyNewsletter\node_modules\@react-native-community\cli\build\index.js:142:9)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.