[英]New Android studio 4.2 Preview having this error when creating buildSrc and build.gradle.kts
I am trying to use buildSrc for dependency management in the new Android 4.2 Preview version and getting this error.我正在尝试在新的 Android 4.2 预览版中使用 buildSrc 进行依赖管理并收到此错误。
Cannot access 'java.lang.Object' which is a supertype of 'org.gradle.api.artifacts.repositories.MavenArtifactRepository'. Check your module classpath for missing or conflicting dependencies
Cannot access class 'java.net.URI'. Check your module classpath for missing or conflicting dependencies
I figured it out, it's due to the Java default JDK coming with the new Android Studio, I believe this will be fixed in the release version.我想通了,这是由于 Java 默认 JDK 与新的 Android Studio 一起提供的,我相信这将在发布版本中修复。
To quickly fix this there are two options:要快速解决此问题,有两种选择:
How to change the JDK in Android studio.如何在 Android studio 中更改 JDK。
delete project/.idea
folder删除project/.idea
文件夹
delete project/.gradle
folder删除project/.gradle
文件夹
restart and reopen the project重新启动并重新打开项目
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.