我无法在 Android 设备上运行 Ionic 应用程序,也无法构建 apk。
我可以在同一台电脑上构建并运行另一个 Android 应用程序。但我无法构建新的应用程序。我陷入了这个错误。
我试过了,
- GradleBuilder.js --> 2048m 到 512m
- 我添加到“环境变量”_JAVA_OPTIONS -Xmx512M
- 我重新安装了 gradle 4.6
抱歉,英语不好。感谢您的帮助!
PS D:\Projects\Ionic3\AuthServiceEx> cordova run android
Android Studio project detected
ANDROID_HOME=C:\Users\[USERNAME]\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_181
studio
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon (subsequent builds will be faster)
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 guide chapter on the daemon at https://docs.gradle.org/4.1/userguide/gradle_daemon.html
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
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
cmd: Command failed with exit code 1 Error output:
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 guide chapter on the daemon at https://docs.gradle.org/4.1/userguide/gradle_daemon.html
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
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
最佳答案
您是否尝试在您的项目中重新安装android平台? 如果不起作用请尝试以下操作: ionic android build - not enough memory to start jvm
关于android - 检测到 Ionic 3 Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52734865/