简体   繁体   中英

Android Studio - build problems after switching JDK to version 1.10

I encountered a problem after switching JDK from version 1.8 to 1.10 in Android Studio. I also know, that problem appears from 1.9. When I build my project it gives me following errors:

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

I'm using OpenJDK version from http://jdk.java.net/java-se-ri/10

My path to JDK directory: JDK path

When i switch back to 1.8 (check "Use embedded JDK") in Project Structure window, everything works just fine.

Thank you for any advice.

It's a plugin issue. Either download the Android Studio Canary build from here .

OR

Download the latest IntelliJ version.

  • update the classpath in build.gradle to: 'com.android.tools.build:gradle:7.0.0-alpha12'
  • update build tools version to: '31.0.0 rc2'
  • update SDK version to: 30

I'd say go for the second option.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM