Anadroid gradle plugin 7.0 and java 11 sdk in unity

1.3k Views Asked by At

My SDK is built using Android gradle plugin AGP 7.0 and java 11 when I am trying to import this library project in Unity I am getting following two errors.

java.lang.UnsupportedOperationException: This feature requires ASM7 See the Console for details.

and another error

Failed to transform artifact 'myerror.aar (:mysdk-21.2.2:)' to match attributes 
{artifactType=android-manifest}
> Execution failed for JetifyTransform: /Users/isnotaname/Documents/UnityProjects/darkness/Temp/gradleOut/unityLibrary/libs/mysdk-21.2.2.aar> Failed to transform
1

There are 1 best solutions below

0
On

The problem is that Unity, currently, doesn't support JDK11, and AGP 7 requires that. Things will break during the build and show JetifyTransform issues or complain about classes in the wrong version being detected. Unfortunately, you'll need to re-export your SDK using JDK8 and Gradle any 6.9.X, or wait to see if Unity 2022.2 is really going to support JDK11, as they have been planning to do.