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.
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.