Android Studio-将JDK切换到1.10版后出现构建问题

时间:2019-07-13 08:58:26

标签: java android-studio

在Android Studio中将JDK从版本1.8切换到1.10后,我遇到了问题。我也知道,这个问题从1.9开始出现。当我构建项目时,它会给我以下错误:

error: cannot access ViewGroup class file for android.view.ViewGroup not found error: cannot access Activity class file for android.app.Activity not found error: cannot access ComponentCallbacks class file for android.content.ComponentCallbacks not found error: cannot access Application class file for android.app.Application not found error: cannot access DialogInterface class file for android.content.DialogInterface not found

我正在使用http://jdk.java.net/java-se-ri/10上的OpenJDK版本

我到JDK目录的路径: JDK path

当我在“项目结构”窗口中切换回1.8(选中“使用嵌入式JDK”)时,一切正常。

谢谢您的建议。

1 个答案:

答案 0 :(得分:1)

这是一个插件问题。 从 here 下载 Android Studio Canary 版本。

下载最新的 IntelliJ 版本。

  • 将 build.gradle 中的类路径更新为:'com.android.tools.build:gradle:7.0.0-alpha12'
  • 将构建工具版本更新为:'31.0.0 rc2'
  • 将 SDK 版本更新为:30

我会说选择第二个选项。

相关问题