簡體   English   中英

無法安裝應用程序 React Native VSCODE

[英]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)   

發生此錯誤主要是因為您的 android 開發環境設置,

我建議你試試這個解決方案;

環境變量

平台工具 安裝JAVA開發包並添加環境變量的路徑,還要確保你的磁盤空間足夠!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM