错误日志:
> Task :instantapp:packageDebugInstantAppBundle FAILED
Task ':instantapp:packageDebugInstantAppBundle' is not up-to-date because:
Task has failed previously.
:instantapp:packageDebugInstantAppBundle (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 1.92 secs.
:Performance_M:packageDebug (Thread[Task worker for ':' Thread 5,5,main]) completed. Took 29.339 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':instantapp:packageDebugInstantAppBundle'.
> Java heap space
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
重点是> Java heap space
错误原因是:提供给java虚拟机默认的内存不足
解决方案:
在构建的项目目录下proj.android-studio/gradle.properties添加下面一行代码即可:
org.gradle.jvmargs=-Xmx2048m
目的是扩大Java虚拟机的内存