Reginer / aosp-android-jar

AOSP编译出的android.jar,sdk里面以前反射调用的方法,现在可以直接调用了。
MIT License
540 stars 79 forks source link

Could not resolve all files for configuration ':app:androidApis'. Unsupported class file major version 61 #29

Closed tumatanquang closed 4 months ago

tumatanquang commented 4 months ago

Hello, I followed the android.jar file replacement guide. However, when I change the Build Variants or build.gradle and have to re-sync the project afterwards, I get the error:

Could not resolve all files for configuration ':app:androidApis'.
Failed to transform android.jar to match attributes {artifactType=android-mockable-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime, returnDefaultValues=false}.
Execution failed for MockableJarTransform: C:\ProgramData\Sdk\platforms\android-34\android.jar.
Unsupported class file major version 61

After that, I tried updating java from JDK-11 to JDK-17 and tried to clean it up then rebuild the project, at this point, only the error Unsupported class file major version 61 appeared.

I tried Invalidate Caches/Restart but still didn't fix the above error.

My Android Studio Info:

Reginer commented 4 months ago

需要使用较新的AS,比如Android Studio Koala | 2024.1.1,或者比这旧一点的。 jdk选择AS自带的jbr