Search Unity

Build Error on Android App Bundle

Discussion in 'Android' started by pabloware, Aug 13, 2022.

  1. pabloware

    pabloware

    Joined:
    Oct 22, 2020
    Posts:
    15
    Hello, I am getting errors while building my app for android. The errors started when I tried to build an AAB at a target API level of 33. Any guidance would be greatly appreciated. Thanks!

    CommandInvokationFailure: Gradle build failed.

    /Applications/Unity/Hub/Editor/2021.3.6f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2021.3.6f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease"



    stderr[

    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

    Note: /Users/pauldesautels/Documents/Pabloware/LEGENDARY_LARRY/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/UnityPlayerActivity.java uses or overrides a deprecated API.

    Note: Recompile with -Xlint:deprecation for details.



    FAILURE: Build failed with an exception.



    * What went wrong:

    Execution failed for task ':launcher:minifyReleaseWithProguard'.

    > java.io.IOException: Can't read [/Applications/Unity/Hub/Editor/2021.3.6f1/PlaybackEngines/AndroidPlayer/SDK/platforms/android-33/optional/android.car.jar] (Can't process class [android/car/Car$CarServiceLifecycleListener.class] (Unsupported version number [55.0] (maximum 54.0, Java 10)))



    * Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.



    * Get more help at https://help.gradle.org



    BUILD FAILED in 15s

    ]

    stdout[

    Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details



    > Configure project :launcher

    WARNING: The option setting 'android.enableR8=false' is deprecated.

    It will be removed in version 5.0 of the Android Gradle plugin.

    You will no longer be able to disable R8



    > Task :unityLibrary:preBuild UP-TO-DATE

    > Task :launcher:preBuild UP-TO-DATE

    > Task :unityLibrary:preReleaseBuild UP-TO-DATE

    > Task :unityLibrary:packageReleaseRenderscript NO-SOURCE

    > Task :unityLibrary:compileReleaseRenderscript NO-SOURCE

    > Task :UnityDataAssetPack:generateAssetPackManifest UP-TO-DATE

    > Task :launcher:extractProguardFiles UP-TO-DATE

    > Task :unityLibrary:generateReleaseResValues UP-TO-DATE

    > Task :unityLibrary:generateReleaseResources UP-TO-DATE

    > Task :launcher:preReleaseBuild UP-TO-DATE

    > Task :unityLibrary:packageReleaseResources UP-TO-DATE

    > Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE

    > Task :launcher:processReleaseAssetPackManifests UP-TO-DATE

    > Task :launcher:linkReleaseManifestForAssetPacks UP-TO-DATE

    > Task :launcher:compileReleaseRenderscript NO-SOURCE

    > Task :launcher:generateReleaseResValues UP-TO-DATE

    > Task :launcher:generateReleaseResources UP-TO-DATE

    > Task :unityLibrary:compileReleaseLibraryResources UP-TO-DATE

    > Task :unityLibrary:compileReleaseAidl NO-SOURCE

    > Task :unityLibrary:generateReleaseBuildConfig

    > Task :launcher:createReleaseCompatibleScreenManifests

    > Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE

    > Task :launcher:mergeReleaseResources UP-TO-DATE

    > Task :unityLibrary:javaPreCompileRelease UP-TO-DATE

    > Task :unityLibrary:processReleaseJavaRes NO-SOURCE

    > Task :launcher:extractDeepLinksRelease UP-TO-DATE

    > Task :unityLibrary:bundleLibResRelease NO-SOURCE

    > Task :unityLibrary:mergeReleaseShaders UP-TO-DATE

    > Task :unityLibrary:compileReleaseShaders NO-SOURCE

    > Task :unityLibrary:generateReleaseAssets UP-TO-DATE

    > Task :launcher:checkReleaseDuplicateClasses UP-TO-DATE

    > Task :launcher:compileReleaseAidl NO-SOURCE

    > Task :launcher:generateReleaseBuildConfig

    > Task :launcher:javaPreCompileRelease UP-TO-DATE

    > Task :launcher:processReleaseJavaRes NO-SOURCE

    > Task :launcher:mergeReleaseJavaResource UP-TO-DATE

    > Task :launcher:mergeReleaseShaders UP-TO-DATE

    > Task :launcher:compileReleaseShaders NO-SOURCE

    > Task :launcher:generateReleaseAssets UP-TO-DATE

    > Task :launcher:mergeReleaseJniLibFolders UP-TO-DATE

    > Task :launcher:collectReleaseDependencies UP-TO-DATE

    > Task :launcher:configureReleaseDependencies UP-TO-DATE

    > Task :launcher:parseReleaseIntegrityConfig UP-TO-DATE

    > Task :launcher:validateSigningRelease UP-TO-DATE

    > Task :unityLibrary:packageReleaseAssets

    > Task :unityLibrary:mergeReleaseJniLibFolders

    > Task :unityLibrary:processReleaseManifest

    > Task :launcher:assetPackReleasePreBundleTask UP-TO-DATE

    > Task :unityLibrary:mergeReleaseNativeLibs

    > Task :unityLibrary:stripReleaseDebugSymbols

    > Task :launcher:processReleaseManifest

    > Task :unityLibrary:copyReleaseJniLibsProjectOnly

    > Task :launcher:mergeReleaseAssets

    > Task :unityLibrary:generateReleaseRFile

    aapt2 W 08-12 16:36:15 64096 2791996 LoadedArsc.cpp:657] Unknown chunk type '200'.



    aapt2 W 08-12 16:36:15 64096 2791996 LoadedArsc.cpp:657] Unknown chunk type '200'.



    > Task :launcher:processReleaseResources

    > Task :launcher:mergeReleaseNativeLibs

    > Task :launcher:stripReleaseDebugSymbols

    > Task :launcher:bundleReleaseResources



    > Task :unityLibrary:compileReleaseJavaWithJavac



    > Task :unityLibrary:mergeReleaseGeneratedProguardFiles UP-TO-DATE

    > Task :unityLibrary:exportReleaseConsumerProguardFiles UP-TO-DATE

    > Task :unityLibrary:bundleLibRuntimeToJarRelease

    > Task :unityLibrary:bundleLibCompileToJarRelease

    > Task :launcher:compileReleaseJavaWithJavac

    > Task :launcher:mergeReleaseGeneratedProguardFiles UP-TO-DATE



    > Task :launcher:minifyReleaseWithProguard FAILED

    ProGuard, version 6.0.3

    Reading input...

    Reading program jar [/Users/pauldesautels/Documents/Pabloware/LEGENDARY_LARRY/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/unity-classes.jar] (filtered)

    Reading program jar [/Users/pauldesautels/.gradle/caches/transforms-2/files-2.1/b6257d464e65990d4b3bc83730a9e910/UnityAds-runtime.jar] (filtered)

    Reading program jar [/Users/pauldesautels/.gradle/caches/transforms-2/files-2.1/f50f8f4811bb1868446a8fa8c1e81c2d/common-runtime.jar] (filtered)

    Reading program jar [/Users/pauldesautels/.gradle/caches/transforms-2/files-2.1/309637c8fe751374308e3a44ad5c886d/billing-4.0.0-runtime.jar] (filtered)

    Reading program jar [/Users/pauldesautels/.gradle/caches/transforms-2/files-2.1/6e1f69c9173f6b668c6234c95ac4c036/core-1.10.0-runtime.jar] (filtered)

    Reading program jar [/Users/pauldesautels/Documents/Pabloware/LEGENDARY_LARRY/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/build/intermediates/runtime_library_classes_jar/release/classes.jar] (filtered)

    Reading program jar [/Users/pauldesautels/Documents/Pabloware/LEGENDARY_LARRY/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/release/R.jar] (filtered)

    Reading program directory [/Users/pauldesautels/Documents/Pabloware/LEGENDARY_LARRY/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/javac/release/classes] (filtered)

    Reading program jar [/Users/pauldesautels/Documents/Pabloware/LEGENDARY_LARRY/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/merged_java_res/release/out.jar] (filtered)

    Reading library jar [/Applications/Unity/Hub/Editor/2021.3.6f1/PlaybackEngines/AndroidPlayer/SDK/platforms/android-33/android.jar]

    Reading library jar [/Applications/Unity/Hub/Editor/2021.3.6f1/PlaybackEngines/AndroidPlayer/SDK/build-tools/30.0.2/core-lambda-stubs.jar]

    Reading library jar [/Applications/Unity/Hub/Editor/2021.3.6f1/PlaybackEngines/AndroidPlayer/SDK/platforms/android-33/optional/org.apache.http.legacy.jar]

    Reading library jar [/Applications/Unity/Hub/Editor/2021.3.6f1/PlaybackEngines/AndroidPlayer/SDK/platforms/android-33/optional/android.car.jar]

    48 actionable tasks: 21 executed, 27 up-to-date

    ]

    exit code: 1

    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    Rethrow as GradleInvokationException: Gradle build failed

    UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.

    UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <0bc7e9c04c1540528b26863a0cb726ae>:0)

    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:370)

    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
     
  2. pabloware

    pabloware

    Joined:
    Oct 22, 2020
    Posts:
    15
    Another Error:

    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

    Note: /Users/pauldesautels/Documents/Pabloware/LEGENDARY_LARRY/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/UnityPlayerActivity.java uses or overrides a deprecated API.

    Note: Recompile with -Xlint:deprecation for details.



    FAILURE: Build failed with an exception.



    * What went wrong:

    Execution failed for task ':launcher:minifyReleaseWithProguard'.

    > java.io.IOException: Can't read [/Applications/Unity/Hub/Editor/2021.3.6f1/PlaybackEngines/AndroidPlayer/SDK/platforms/android-33/optional/android.car.jar] (Can't process class [android/car/Car$CarServiceLifecycleListener.class] (Unsupported version number [55.0] (maximum 54.0, Java 10)))



    * Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.



    * Get more help at https://help.gradle.org



    BUILD FAILED in 15s



    UnityEngine.GUIUtility:processEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
     
  3. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    • Java 8 -> 52
    • Java 9 -> 53
    • Java 10 -> 54
    • Java 11 -> 55
    This means that class file was compiled (to byte code) using a higher version of java compared to the one you currently use.

    I would love to see how this problem will get solved and unfortunately, I can't reproduce/test it now. I will keep watching.
    This is an interesting issue because, unity doesn't support no greater than Java 8 but android library it self is compiled with Java 11 which is a bit surprising.

    For the time being, please use A̶p̶i̶ 3̶2̶ API 33 (check below)as it will be good target for next 2 years roughly to by pass the issue.

    Update
    Try with API level 33 now as new norm is coming up where google expects only builds targeting api 33 from Aug 31 2023. Please check this reference.
     
    Last edited: Jun 17, 2023
  4. pabloware

    pabloware

    Joined:
    Oct 22, 2020
    Posts:
    15
    Thanks for the info! Build succeeds.
     
    Voxel-Busters likes this.
  5. xtdiwd

    xtdiwd

    Joined:
    Jul 25, 2020
    Posts:
    135
    I also have a similar problem.
    I'm not sure I have it all understood. I upgraded to 2021.3.12 and tried API target 32 but I get the error
    Code (Boo):
    1. Android SDK does not include your Target SDK of 32.
    2. Please use the Android SDK Manager to install your target SDK version. Restart Unity after SDK installation for the changes to take effect.
    3.  
    This target api seems to be installed in android studio. And Unity itself usually installs what is needed anyway.
    It doesn't work for me, what should I do?
     
  6. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    If you set Target API as 32 in your Player Settings -> Android -> Other Settings -> Target API and build, it should show a prompt to download sdk 32. If it doesn't you have the following manual option.
    1. Install Android Studio, if you haven't yet
    2. From SDK installer, install API 32
    3. Open the install folder and copy it (platforms/android-32)
    4. Paste it in Unity's Android SDK folder (under platforms)
    5. Restart unity

    Usual reason we saw for not unity upgrading automatically is because of the folder access rights. Try with admin access and if not, proceed with above manual process.
     
    Last edited: Oct 27, 2022
  7. securegames123

    securegames123

    Joined:
    Jun 30, 2020
    Posts:
    12
    Hi, I can confirm we are also running into the same issue. We have recently integrated Admob mediation SDK in our game and we are getting this error in build while generating apk. Note that this error occur when we enable proguard option (Release) under publshing > minify > release.


    * What went wrong:
    Execution failed for task ':launcher:minifyReleaseWithProguard'.
    > java.io.IOException: Can't read [C:\Users\Plasma\.gradle\caches\transforms-2\files-2.1\61f3b99406cc323f0226be9bc77a28cd\googlemobileads-unity-runtime.jar(;;;;;;;**.class)] (Can't process class [com/google/unity/ads/AdNetworkExtras.class] (Unsupported version number [55.0] (maximum 54.0, Java 10)))


    We are using Unity 2020.3.38f1 LTS and Target API 32. Admob mediation also include Meta(Facebook) ad services. Is there any work around to tackle this issue. May be changing some values or version number in some file. ???
     
    Last edited: Oct 28, 2022
  8. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    As per the error, it looks like Proguard version used by unity is not supporting the compiled class (which is compiled with a higher version).

    Try upgrading the proguard version and see if it works.
     
    securegames123 likes this.
  9. securegames123

    securegames123

    Joined:
    Jun 30, 2020
    Posts:
    12
    So how to upgrade proguard version. I already tried to find a solution for upgrading a proguard version. but can't find solution.
     
  10. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    May I know your unity version and gradle version you are currently using?
     
  11. securegames123

    securegames123

    Joined:
    Jun 30, 2020
    Posts:
    12
    Unity 2020.3.38f1 LTS and Target API 32 and gradle version is 6.1.1
     
  12. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Can you try upgrading gradle version from 6.1.1 to a higher version.
    or
    As per this, you need to specify in your gradle file.

    Try this
    1. Enable baseGradle template from player settings
    2. Enter the proguard classpath like below

    Code (CSharp):
    1. buildscript {
    2.     repositories {
    3.         google()       // For the Android Gradle plugin.
    4.         mavenCentral() // For the ProGuard Gradle Plugin and anything else.
    5.     }
    6.     dependencies {
    7.         classpath 'com.android.tools.build:gradle:x.y.z'    // The Android Gradle plugin. (You may have 3.4.3 or 4.0.1 or 4.1.1 here)
    8.         classpath 'com.guardsquare:proguard-gradle:7.1.0'  // The ProGuard Gradle plugin. <= Add this line
    9.     }
    10. }
     
    Last edited: May 3, 2023
  13. securegames123

    securegames123

    Joined:
    Jun 30, 2020
    Posts:
    12
    caerux likes this.
  14. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Ok, if you get a chance, try the above solution and let me know if it works :)
     
  15. securegames123

    securegames123

    Joined:
    Jun 30, 2020
    Posts:
    12
    ok. we will try that too. thanks for helping me out
     
  16. domonyiv

    domonyiv

    Joined:
    Oct 1, 2016
    Posts:
    76
    @Voxel-Busters I tried your solution, but I get the following error:

    Code (CSharp):
    1.  
    2. * What went wrong:
    3. A problem occurred configuring project ':launcher'.
    4. > Could not resolve all artifacts for configuration ':launcher:classpath'.
    5.    > Could not resolve com.guardsquare:proguard-base:7.1.0.
    6.      Required by:
    7.          project :launcher > com.guardsquare:proguard-gradle:7.1.0
    8.       > Could not resolve com.guardsquare:proguard-base:7.1.0.
    9.          > Could not get resource 'https://jcenter.bintray.com/com/guardsquare/proguard-base/7.1.0/proguard-base-7.1.0.module'.
    10.             > Could not GET 'https://jcenter.bintray.com/com/guardsquare/proguard-base/7.1.0/proguard-base-7.1.0.module'.
    11.                > Read timed out
    12.  
    13.  
    UPDATE: I solved it by adding mavenCentral() to the repositories:

    Code (CSharp):
    1. buildscript {
    2.         repositories {**ARTIFACTORYREPOSITORY**
    3.             google()
    4.             mavenCentral()
    5.             jcenter()
    6.         }
    7.  
    8.         dependencies {
    9.             // If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity
    10.             // See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html
    11.             // See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
    12.             // To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version
    13.             classpath 'com.android.tools.build:gradle:4.0.1'
    14.             classpath 'com.guardsquare:proguard-gradle:7.1.0'
    15.             **BUILD_SCRIPT_DEPS**
    16.         }
    17.     }
     
    Last edited: Oct 31, 2022
    hiitten likes this.
  17. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    JCenter is down! Just delete it or move it to bottom so that others get priority!
     
  18. domonyiv

    domonyiv

    Joined:
    Oct 1, 2016
    Posts:
    76
    @Voxel-Busters Thanks. Yesterday it worked fine, but today it fails with a different message. "java.lang.UnsupportedOperationException: This feature requires ASM7"
    Any idea what might be causing this?

    Code (CSharp):
    1. error processing C:\UnityProjects\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build\intermediates\shrunk_jar\release\minified.jar
    2. java.lang.UnsupportedOperationException: This feature requires ASM7
    3.     at org.objectweb.asm.ClassVisitor.visitNestHost(ClassVisitor.java:150)
    4.     at org.objectweb.asm.ClassReader.accept(ClassReader.java:541)
    5.     at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)
    6.     at com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:153)
    7.     at com.android.builder.desugaring.DesugaringClassAnalyzer.analyzeJar(DesugaringClassAnalyzer.java:100)
    8.     at com.android.builder.desugaring.DesugaringClassAnalyzer.analyze(DesugaringClassAnalyzer.java:68)
    9.     at com.android.build.gradle.internal.tasks.DesugarIncrementalHelper.lambda$getInitalGraphData$4(DesugarIncrementalHelper.java:146)
    10.     at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
    11.     at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    12.     at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    13.     at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    14.     at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
    15.  
    16. FAILURE: Build failed with an exception.
    17.  
    18. * What went wrong:
    19. Execution failed for task ':launcher:dexBuilderRelease'.
    20. > java.lang.UnsupportedOperationException: This feature requires ASM7
    21.  
    UPDATE: Switching Target API level to 30 then back to 31 and now it is building fine. I have no idea what is going on. :)
     
    Last edited: Nov 2, 2022
  19. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Not sure what could be the reason, but please let us know if you hit this issue again.
     
    ridwanfauzy likes this.
  20. Baydogan

    Baydogan

    Joined:
    Mar 22, 2018
    Posts:
    54
    @domonyiv This is a fake error :)

    Try this steps.

    1. Just do a clean build.

    if it does not work

    2. Close and open unity, Change Max API to 32 try a build and Change it back to something different and try again.

    I think it is something related to a cache problem inside unity.



    UPDATE: I did not saw your update :) Glad it worked for you.
     
    domonyiv and Voxel-Busters like this.
  21. pratham_kode

    pratham_kode

    Joined:
    Sep 12, 2022
    Posts:
    1
    Can you please elaborate more on this , it will be helpfull . And can you also tell how to install API 32 components?
    your help is appreciated
    update :- I tried API 32 and it worked. Thanks a lot !!!!
     
    Last edited: Nov 7, 2022
    Voxel-Busters likes this.
  22. caerux

    caerux

    Joined:
    Jan 24, 2019
    Posts:
    1
    This solution worked for me
     
  23. scorp2007

    scorp2007

    Joined:
    Aug 17, 2014
    Posts:
    54
    i selected Target API32 and try build, and this error still appears (also i try use version admob 7.2.0 and no result) :mad:
     
  24. vizgl

    vizgl

    Joined:
    Nov 4, 2014
    Posts:
    61
    Same happened, I'd tried many things to make it work again, but it fail. Got error java.lang.UnsupportedOperationException: This feature requires ASM7
     
  25. Baydogan

    Baydogan

    Joined:
    Mar 22, 2018
    Posts:
    54
    @scorp2007 Can you share the error log?

    @vizgl please try the steps I recommended.

    Most importantly. CLEAN BUILD AND CHANGE TARGET API.
     
  26. Supratim

    Supratim

    Joined:
    Dec 1, 2008
    Posts:
    9
  27. SquaxShaun

    SquaxShaun

    Joined:
    Jun 22, 2009
    Posts:
    63
    Thanks Supratim, that worked for me.
     
  28. crosx97

    crosx97

    Joined:
    Apr 4, 2021
    Posts:
    2
    this fixed the problem for me thanks
     
    matess137 and Voxel-Busters like this.
  29. EvilSaint007

    EvilSaint007

    Joined:
    Sep 21, 2021
    Posts:
    3
    I solved it by enabling R8, API Level 33 and downgrading Google Admob Package from version 7.3.1 to 7.0.2. No custom build / gradle files. After saving these settings, close Unity and delete .android & .gradle folders in C\:users/YourPCName/.... restart Unity and build. I also changed apk file directory but not sure which one of these settings worked.
     
    elaissaouihamza likes this.
  30. boypipz321

    boypipz321

    Joined:
    Jan 27, 2018
    Posts:
    7
    Ranger0509 and lazycoder00000 like this.
  31. ExcaliburGames

    ExcaliburGames

    Joined:
    Oct 29, 2013
    Posts:
    50
    What helped me in similar situation - delete Library folder.
     
  32. PlurInteractive

    PlurInteractive

    Joined:
    Feb 3, 2020
    Posts:
    2
    Are any of you getting an issue after applying some of these fixes, where you're able to compile the app-package or apk, but Admob just isn't loading any ads while testing on an actual mobile device? I've been banging my head against the wall for a few days trying to figure this out. My admob account is all set, I do have a previous test version that was properly loading ads and if I load it up it still does. I just need to know if not, then it has to do something with my implementation.
     
  33. boypipz321

    boypipz321

    Joined:
    Jan 27, 2018
    Posts:
    7
    Try Setting your "Minumum API Level to 24"
    upload_2023-3-1_23-38-4.png
     
  34. ProphetGod117

    ProphetGod117

    Joined:
    Feb 21, 2017
    Posts:
    4
    I have the same problem and I can't find a solution, I have already tried with different versions of google mobile ads, but when I apply everything, test ads appear in the editor but when I make the build and open it in any phone, not even the test ads appear.
     
  35. hiitten

    hiitten

    Joined:
    Jul 25, 2020
    Posts:
    3

    Thanks a lot. this worked for me.
     
    Voxel-Busters likes this.
  36. simsim_apps

    simsim_apps

    Joined:
    Mar 25, 2023
    Posts:
    7
    Thanks, I had a similar problem in Editor 2021.3.21f1 , I chose API Level 32 and check the option User R8 in Player Settings, and that worked for me
     
  37. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,963
    Try with API level 33 now as new norm is coming up where google expects only builds targetting api 33 from Aug 31 2023. Please check this reference.
     
    simsim_apps likes this.
  38. simsim_apps

    simsim_apps

    Joined:
    Mar 25, 2023
    Posts:
    7
    I used the guide in the link to modify the progaurd file and it worked for me

    just in case, if the link didn't work
    Solution:

    Build Settings > Player Setting > Publishing Settings > Custom Progurard File
    Code (Boo):
    1. -keep class com.google.unity.** {
    2.    *;
    3. }
    4. -keep public class com.google.android.gms.ads.**{
    5.    public *;
    6. }
    7. -keep public class com.google.ads.**{
    8.    public *;
    9. }
    10. -keepattributes *Annotation*
    11. -dontobfuscate
     
    leoinds and Flaviof like this.
  39. zaynn

    zaynn

    Joined:
    Aug 30, 2015
    Posts:
    2
    upload_2023-11-17_15-37-10.png
    In my case using 2020.3.34f1, setting these settings, especially toggle off the release,
    and target api 33 solved my issue.