Mac M1 Android Gradle build daemon disappeared unexpectedly (it may have been killed or may have ...

问题

新换的Mac M1 在做Android build的时候发现如下问题,网上之前的各种解决方案都无效。


FAILURE: Build failed with an exception.

* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

终极解决方案为:

Oracle 的jdk 1.8 和 Mac M1 不兼容,只需要把jdk的环境变量设置为Android Studio 4.1.3 自动的sdk即可

在你的 .bash_profile或者.zshrc 文件做如下设置,问题完美解决。

JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/
export JAVA_HOME

你可能感兴趣的:(Mac M1 Android Gradle build daemon disappeared unexpectedly (it may have been killed or may have ...)