I have found when building for Android in Unity that I frequently come across the error “This feature requires ASM7”. The error kindly indicates that you check the console for further information, where you can find the following output;
error processing C:\Users\username\.gradle\caches\transforms-2\files-2.1\960a80ab4de82401f7fb138bb94039f3\googlemobileads-unity-runtime.jar
java.lang.UnsupportedOperationException: This feature requires ASM7
at org.objectweb.asm.ClassVisitor.visitNestHost(ClassVisitor.java:150)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:541)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)
at com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:153)
at com.android.builder.desugaring.DesugaringClassAnalyzer.analyzeJar(DesugaringClassAnalyzer.java:100)
at com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:68)
at com.android.build.gradle.internal.tasks.DesugarIncrementalHelper.lambda$getInitalGraphData$4(DesugarIncrementalHelper.java:146)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:dexBuilderRelease'.
> java.lang.UnsupportedOperationException: This feature requires ASM7
BUILD FAILED in 1s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

After some investigation I found that temporarily changing the Minimum API level in the Unity Project Settings would alleviate the issue, but it kept happening so I investigated further.
Which feature requires ASM7?
In my instance, it is either the Google AdMob component or a library included with the Google AdMob component that results in this error occurring.
Starting fresh

To actually resolve the issue when it occurs, simply select “Clean Build” from the Build button when compiling the project. This will ensure that everything is correctly initialized and avoid the “feature requires ASM7” error occurring without having to change any other settings or implement workarounds!