我无法同步或构建Android项目,因为有两个错误:
1.首先,我得到了:
> =============================== Gradle Doctor Prescriptions ============================================
| JAVA_HOME is not set. |
| Please set JAVA_HOME so that switching between Android Studio and the terminal does not trigger a fu |
| ll rebuild. |
| To set JAVA_HOME: (using bash) |
| echo "export JAVA_HOME=$(/usr/libexec/java_home)" >> ~/.bash_profile |
| or `~/.zshrc` if using zsh. |
========================================================================================================
1.然后Clean Project之后
/Library/Internet
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
Caused by: java.nio.file.NoSuchFileException: /Library/Internet
at com.osacky.doctor.JavaHomeCheck.isGradleUsingJavaHome(JavaHomeCheck.kt:68)
at com.osacky.doctor.JavaHomeCheck.onStart(JavaHomeCheck.kt:41)
at com.osacky.doctor.DoctorPlugin$apply$1.execute(DoctorPlugin.kt:61)
at com.osacky.doctor.DoctorPlugin$apply$1.execute(DoctorPlugin.kt:29)
我很确定JAVA_HOME设置正确,Gradle版本与此处描述的插件版本兼容。我清理了项目,使“无效并重新启动”,甚至删除和添加了项目。
任何帮助都很感激。
1条答案
按热度按时间8dtrkrch1#
我终于找到了解决办法:为了摆脱错误,我需要禁用
build.gradle.kts
中的一个插件(项目级别)我通过从
plugins
中删除id("com.osacky.doctor") version "0.7.0"
来解决它