Search Unity

Question Gradle build fails after installing unity ads package

Discussion in 'Android' started by Fili_7000, Feb 3, 2023.

  1. Fili_7000

    Fili_7000

    Joined:
    Jan 4, 2020
    Posts:
    3
    Hi everyone. I've got an android project going on and it all goes smoothly until i try to implement ads. As soon as i turn on the unity ads and install the ads package, my game doesn't build anymore and gives me this Gradle build failed error. I've really tried anything so everything helps. Thank you.

    Console:

    Configure project :launcher warning: C:\Users\fili7\OneDrive\Desktop\Unity Proj\Lio\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\libs\classes.jar(com/samsung/android/gamesdk/GameSDKManager.class): major version 53 is newer than 52, the highest major version supported by this compiler. It is recommended that the compiler be upgraded. CommandInvokationFailure: Gradle build failed. C:\Program Files\Unity\Hub\Editor\2021.3.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2021.3.11f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease" Build completed with a result of 'Failed' in 46 seconds (46351 ms) UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&) UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in :0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0 UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,920
    I think it's complaining about GameSDKManager.class being compiled with newer Java than the one Unity uses in 2021.3.

    One way to fix this is to switch to Unity 2022.2 where higher Java version is used.