Android Studio - Build Problems After Switching Jdk to Version 1.10

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

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.

3

1 Answer

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.