Search Unity

Bug The option setting 'android.enableR8=false' is deprecated. Conflict between Admob & Firebase Plugin

Discussion in 'Unity Analytics' started by aqsanadeem82, Mar 31, 2023.

  1. aqsanadeem82

    aqsanadeem82

    Joined:
    Sep 15, 2018
    Posts:
    76
    I was using Admob and it was building the game fine but when I Imported the firebase plugin it give the following error:
    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

    I also encountered this error when I tried to implement a leaderboard when google admob and firebase was already there, in another project.

    I have tried nearly all solutions in this regard, but nothing works for me.
    Such as using this solution http://answers.unity.com/answers/1859781/view.htmlhttp://answers.unity.com/answers/1859781/view.html
    I need help with this.
     
  2. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    192
    It depends on the version of Unity you are using?
    1. Check the Unity Console for any additional error messages or warnings that may provide more information about the problem.

    2. Check that the correct Android SDK and JDK versions are installed on your system, and that they are correctly set up in the Unity Editor. You can do this by going to Edit > Preferences > External Tools, and checking that the correct paths are set for the Android SDK and JDK.

    3. Make sure that you have the correct versions of the Google Mobile Ads and Firebase plugins for your Unity version. Check the documentation for the plugins to ensure that they are compatible with your version of Unity.

    4. Try removing both the Google Mobile Ads and Firebase plugins from your project, and then re-importing them in the correct order. The correct order to import them is: Admob > Firebase
      After importing the plugins, rebuild your project and see if the issue is resolved
    If the above steps do not work to resolve the issue, there are a few additional things you can try:
    1. Check the "Plugins/Android/mainTemplate.gradle" file in your project's directory. If the line "android.enableR8=false" is present, remove it and save the file.
    Let me know if you have any further questions or if there's anything else I can do to assist you with your Unity project.
     
  3. aqsanadeem82

    aqsanadeem82

    Joined:
    Sep 15, 2018
    Posts:
    76
    Okay, So I was finally able to create my build. I did two things
    First I Upgraded my project from Unity 2020 to 2021.
    Secondly, I deleted the Cache C:/User/UserName/.gradle/cache folder only...

    And Created the build again and it worked.
     
    unitytest116 and Julian-Unity3D like this.
  4. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    192
    Glad to hear its working
     
  5. aqsanadeem82

    aqsanadeem82

    Joined:
    Sep 15, 2018
    Posts:
    76
    But its not working for new builds again
     
  6. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    192
    On which version of Unity?
     
  7. DhiaSendi

    DhiaSendi

    Joined:
    May 16, 2018
    Posts:
    43
    In my case (Unity 2021.3.26) ticking "Use R8" fixed the issue
    Player settings > Publishing settings >Minify
    Capture.PNG
     
    VOXELIUM likes this.
  8. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I have the same issue on Unity 2021.3.29f1
    I think upgrading my LTS version to a newer one was the cause but I'm not sure.

    The Minify > Use R8 toggled on or off gives me errors that say it's deprecated in both cases.

    Any suggestions?

    Here's some additional error logs.

    Code (CSharp):
    1. > Configure project :launcher
    2. WARNING: The option setting 'android.enableR8=false' is deprecated.
    3. It will be removed in version 5.0 of the Android Gradle plugin.
    4. You will no longer be able to disable R8
    5.  
    6. > Task :launcher:preBuild UP-TO-DATE
    7. > Task :launcher:preDebugBuild UP-TO-DATE
    8. > Task :unityLibrary:preBuild UP-TO-DATE
    9. > Task :unityLibrary:preDebugBuild UP-TO-DATE
    10. > Task :unityLibrary:compileDebugAidl NO-SOURCE
    11. > Task :unityLibrary:packageDebugRenderscript NO-SOURCE
    12. > Task :unityLibrary:compileDebugRenderscript NO-SOURCE
    13. > Task :unityLibrary:generateDebugResValues UP-TO-DATE
    14. > Task :unityLibrary:generateDebugResources UP-TO-DATE
    15. > Task :launcher:generateDebugBuildConfig
    16. > Task :launcher:compileDebugAidl NO-SOURCE
    17. > Task :launcher:compileDebugRenderscript NO-SOURCE
    18. > Task :launcher:javaPreCompileDebug UP-TO-DATE
    19. > Task :launcher:generateDebugResValues UP-TO-DATE
    20. > Task :unityLibrary:packageDebugResources UP-TO-DATE
    21. > Task :launcher:generateDebugResources UP-TO-DATE
    22. > Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
    23. > Task :launcher:mergeDebugResources UP-TO-DATE
    24. > Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
    25. > Task :launcher:createDebugCompatibleScreenManifests
    26. > Task :launcher:extractDeepLinksDebug UP-TO-DATE
    27. > Task :launcher:mergeDebugShaders UP-TO-DATE
    28. > Task :launcher:compileDebugShaders NO-SOURCE
    29. > Task :launcher:generateDebugAssets UP-TO-DATE
    30. > Task :launcher:processDebugJavaRes NO-SOURCE
    31. > Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
    32. > Task :launcher:checkDebugDuplicateClasses UP-TO-DATE
    33. > Task :launcher:desugarDebugFileDependencies UP-TO-DATE
    34. > Task :launcher:mergeExtDexDebug UP-TO-DATE
    35. > Task :launcher:mergeDebugJniLibFolders UP-TO-DATE
    36. > Task :unityLibrary:generateDebugBuildConfig
    37. > Task :launcher:validateSigningDebug UP-TO-DATE
    38. > Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
    39. > Task :unityLibrary:mergeDebugShaders UP-TO-DATE
    40. > Task :unityLibrary:compileDebugShaders NO-SOURCE
    41. > Task :unityLibrary:generateDebugAssets UP-TO-DATE
    42. > Task :unityLibrary:packageDebugAssets
    43. > Task :unityLibrary:processDebugJavaRes UP-TO-DATE
    44. > Task :unityLibrary:bundleLibResDebug UP-TO-DATE
    45. > Task :unityLibrary:mergeDebugJniLibFolders
    46. > Task :unityLibrary:processDebugManifest
    47. > Task :unityLibrary:mergeDebugNativeLibs
    48. > Task :u...
    49.  
    50.  
    51. > Task :unityLibrary:compileDebugJavaWithJavac FAILED
    52.  
    53. > Task :launcher:processDebugResources
    54. 33 actionable tasks: 14 executed, 19 up-to-date
    55.  
    56. UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
    57.  

    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:164: error: cannot find symbol
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
    ^
    symbol: variable TIRAMISU
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:165: error: cannot find symbol
    permissionGranted = mContext.checkCallingOrSelfPermission(Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
    ^
    symbol: variable POST_NOTIFICATIONS
    location: class permission
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:592: error: cannot find symbol
    return alarmManager.canScheduleExactAlarms();
    ^
    symbol: method canScheduleExactAlarms()
    location: variable alarmManager of type AlarmManager
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:944: error: cannot find symbol
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
    ^
    symbol: variable S
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:946: error: incompatible types: Icon cannot be converted to Bitmap
    style.bigPicture(icon);
    ^
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:954: error: cannot find symbol
    Object pic = getIconFromResources(picture, Build.VERSION.SDK_INT < Build.VERSION_CODES.S);
    ^
    symbol: variable S
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:955: error: cannot find symbol
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && pic instanceof Icon)
    ^
    symbol: variable S
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:956: error: incompatible types: Icon cannot be converted to Bitmap
    style.bigPicture((Icon)pic);
    ^
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:963: error: cannot find symbol
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
    ^
    symbol: variable S
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:964: error: cannot find symbol
    style.setContentDescription(extras.getString(KEY_BIG_CONTENT_DESCRIPTION));
    ^
    symbol: method setContentDescription(String)
    location: variable style of type BigPictureStyle
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:965: error: cannot find symbol
    style.showBigPictureWhenCollapsed(extras.getBoolean(KEY_BIG_SHOW_WHEN_COLLAPSED, false));
    ^
    symbol: method showBigPictureWhenCollapsed(boolean)
    location: variable style of type BigPictureStyle
    Note: E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
    11 errors

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.



    CommandInvokationFailure: Gradle build failed.
    E:\__UnityVersions\2021.3.29f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "E:\__UnityVersions\2021.3.29f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"

    Environment Variables:
    USERDOMAIN = FEAST-SAGER
    ProgramFiles = C:\Program Files
    LAUNCH_DARKLY_CLIENT_TOKEN = 60a7e30fafc7e60e33446283
    TMP = C:\Users\Feast\AppData\Local\Temp
    PROCESSOR_ARCHITECTURE = AMD64
    PROCESSOR_REVISION = 5e03
    OneDriveConsumer = C:\Users\Feast\OneDrive
    OS = Windows_NT
    CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_3176_TLDQOEIURSQHRZBY
    PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
    ProgramW6432 = C:\Program Files
    USERPROFILE = C:\Users\Feast
    JAVA_HOME = E:\__UnityVersions\2021.3.29f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
    CommonProgramFiles = C:\Program Files\Common Files
    DriverData = C:\Windows\System32\Drivers\DriverData
    ComSpec = C:\WINDOWS\system32\cmd.exe
    AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
    PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
    ANDROID_NDK_ROOT = E:\__UnityVersions\2021.3.29f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
    SystemRoot = C:\WINDOWS
    HEAP_CLIENT_TOKEN = 1717415662
    NUMBER_OF_PROCESSORS = 8
    AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
    WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3
    JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
    DEBUG_ENV_VAR = UnityHub
    BURST_ANDROID_MIN_API_LEVEL = 22
    TEMP = C:\Users\Feast\AppData\Local\Temp
    Path = C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Users\Feast\AppData\Local\Microsoft\WindowsApps;C:\Users\Feast\.dotnet\tools
    USERNAME = Feast
    COMPUTERNAME = FEAST-SAGER
    PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    SystemDrive = C:
    ALLUSERSPROFILE = C:\ProgramData
    SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
    HEAP_CLIENT_TOKEN_STAGING = 3786794399
    windir = C:\WINDOWS
    HOMEPATH = \Users\Feast
    PUBLIC = C:\Users\Public
    CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
    APPDATA = C:\Users\Feast\AppData\Roaming
    OneDrive = C:\Users\Feast\OneDrive
    PROCESSOR_LEVEL = 6
    CommonProgramW6432 = C:\Program Files\Common Files
    ProgramFiles(x86) = C:\Program Files (x86)
    SESSIONNAME = Console
    LOGONSERVER = \\FEAST-SAGER
    LOCALAPPDATA = C:\Users\Feast\AppData\Local
    VBOX_MSI_INSTALL_PATH = C:\Program Files\Oracle\VirtualBox\
    LAUNCH_DARKLY_CLIENT_TOKEN_STAGING = 60a7e30fafc7e60e33446282
    HOMEDRIVE = C:
    USERDOMAIN_ROAMINGPROFILE = FEAST-SAGER
    ProgramData = C:\ProgramData
    ORIGINAL_XDG_CURRENT_DESKTOP = undefined


    stderr[
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:164: error: cannot find symbol
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
    ^
    symbol: variable TIRAMISU
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:165: error: cannot find symbol
    permissionGranted = mContext.checkCallingOrSelfPermission(Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
    ^
    symbol: variable POST_NOTIFICATIONS
    location: class permission
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:592: error: cannot find symbol
    return alarmManager.canScheduleExactAlarms();
    ^
    symbol: method canScheduleExactAlarms()
    location: variable alarmManager of type AlarmManager
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:944: error: cannot find symbol
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
    ^
    symbol: variable S
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:946: error: incompatible types: Icon cannot be converted to Bitmap
    style.bigPicture(icon);
    ^
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:954: error: cannot find symbol
    Object pic = getIconFromResources(picture, Build.VERSION.SDK_INT < Build.VERSION_CODES.S);
    ^
    symbol: variable S
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:955: error: cannot find symbol
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && pic instanceof Icon)
    ^
    symbol: variable S
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:956: error: incompatible types: Icon cannot be converted to Bitmap
    style.bigPicture((Icon)pic);
    ^
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:963: error: cannot find symbol
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
    ^
    symbol: variable S
    location: class VERSION_CODES
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:964: error: cannot find symbol
    style.setContentDescription(extras.getString(KEY_BIG_CONTENT_DESCRIPTION));
    ^
    symbol: method setContentDescription(String)
    location: variable style of type BigPictureStyle
    E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:965: error: cannot find symbol
    style.showBigPictureWhenCollapsed(extras.getBoolean(KEY_BIG_SHOW_WHEN_COLLAPSED, false));
    ^
    symbol: method showBigPictureWhenCollapsed(boolean)
    location: variable style of type BigPictureStyle
    Note: E:\Unity Projects\Wordle\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
    11 errors

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':unityLibrary:compileDebugJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.

    * 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 3s
    Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    ]
    stdout[

    > 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 :launcher:preBuild UP-TO-DATE
    > Task :launcher:preDebugBuild UP-TO-DATE
    > Task :unityLibrary:preBuild UP-TO-DATE
    > Task :unityLibrary:preDebugBuild UP-TO-DATE
    > Task :unityLibrary:compileDebugAidl NO-SOURCE
    > Task :unityLibrary:packageDebugRenderscript NO-SOURCE
    > Task :unityLibrary:compileDebugRenderscript NO-SOURCE
    > Task :unityLibrary:generateDebugResValues UP-TO-DATE
    > Task :unityLibrary:generateDebugResources UP-TO-DATE
    > Task :launcher:generateDebugBuildConfig
    > Task :launcher:compileDebugAidl NO-SOURCE
    > Task :launcher:compileDebugRenderscript NO-SOURCE
    > Task :launcher:javaPreCompileDebug UP-TO-DATE
    > Task :launcher:generateDebugResValues UP-TO-DATE
    > Task :unityLibrary:packageDebugResources UP-TO-DATE
    > Task :launcher:generateDebugResources UP-TO-DATE
    > Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
    > Task :launcher:mergeDebugResources UP-TO-DATE
    > Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
    > Task :launcher:createDebugCompatibleScreenManifests
    > Task :launcher:extractDeepLinksDebug UP-TO-DATE
    > Task :launcher:mergeDebugShaders UP-TO-DATE
    > Task :launcher:compileDebugShaders NO-SOURCE
    > Task :launcher:generateDebugAssets UP-TO-DATE
    > Task :launcher:processDebugJavaRes NO-SOURCE
    > Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
    > Task :launcher:checkDebugDuplicateClasses UP-TO-DATE
    > Task :launcher:desugarDebugFileDependencies UP-TO-DATE
    > Task :launcher:mergeExtDexDebug UP-TO-DATE
    > Task :launcher:mergeDebugJniLibFolders UP-TO-DATE
    > Task :unityLibrary:generateDebugBuildConfig
    > Task :launcher:validateSigningDebug UP-TO-DATE
    > Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
    > Task :unityLibrary:mergeDebugShaders UP-TO-DATE
    > Task :unityLibrary:compileDebugShaders NO-SOURCE
    > Task :unityLibrary:generateDebugAssets UP-TO-DATE
    > Task :unityLibrary:packageDebugAssets
    > Task :unityLibrary:processDebugJavaRes UP-TO-DATE
    > Task :unityLibrary:bundleLibResDebug UP-TO-DATE
    > Task :unityLibrary:mergeDebugJniLibFolders
    > Task :unityLibrary:processDebugManifest
    > Task :unityLibrary:mergeDebugNativeLibs
    > Task :unityLibrary:stripDebugDebugSymbols
    > Task :unityLibrary:copyDebugJniLibsProjectOnly
    > Task :unityLibrary:generateDebugRFile
    > Task :launcher:mergeDebugAssets
    > Task :launcher:processDebugManifest

    > Task :unityLibrary:compileDebugJavaWithJavac FAILED

    > Task :launcher:processDebugResources
    33 actionable tasks: 14 executed, 19 up-to-date
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f7e0d4f8e9fc466a8f9b676d3e985bcb>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f7e0d4f8e9fc466a8f9b676d3e985bcb>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <f7e0d4f8e9fc466a8f9b676d3e985bcb>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <f7e0d4f8e9fc466a8f9b676d3e985bcb>: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 <f7e0d4f8e9fc466a8f9b676d3e985bcb>: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 <f7e0d4f8e9fc466a8f9b676d3e985bcb>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f7e0d4f8e9fc466a8f9b676d3e985bcb>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f7e0d4f8e9fc466a8f9b676d3e985bcb>: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 <f7e0d4f8e9fc466a8f9b676d3e985bcb>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <f7e0d4f8e9fc466a8f9b676d3e985bcb>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <f7e0d4f8e9fc466a8f9b676d3e985bcb>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <f7e0d4f8e9fc466a8f9b676d3e985bcb>: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 <1e8c82ffe64a4e1d8e997fa7e593
     
    SushkoTech likes this.
  9. LastChaos

    LastChaos

    Joined:
    Dec 9, 2013
    Posts:
    39
    Same problem. Did you find the solution?
     
  10. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    Unfortunately, I haven't :(
     
  11. pinalabs

    pinalabs

    Joined:
    Jul 10, 2023
    Posts:
    3
    i get the same error and more when i want to add level play ad from IronSource
     
    Vickey_Soni likes this.
  12. pinalabs

    pinalabs

    Joined:
    Jul 10, 2023
    Posts:
    3
    I have been trying to find a solution for two months now, is this a problem in me?
     
  13. pinalabs

    pinalabs

    Joined:
    Jul 10, 2023
    Posts:
    3
    i finally did it, for me it was a problem with androidX this video helped me
     
    Miryum likes this.
  14. jonathanglitchers

    jonathanglitchers

    Joined:
    Jan 5, 2023
    Posts:
    8
    In my case (probably not for most people struggling with gradle being gradle), the solution was just to:
    - wipe anything vaguely plugin related
    - kill all gradle/java instances
    - delete c:\users\me\.gradle
    - close and reopen the project (unload any .dll's etc)

    You still have to use gradle, but at least it might now work.
     
    Dunng likes this.
  15. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I uninstalled the "Mobile Notifications" (a package from Unity in the Package manager)
    And set the max Android version to a lower version (Android 11.0)

    Now it builds.
     
  16. Akheerstudio

    Akheerstudio

    Joined:
    Dec 1, 2017
    Posts:
    3
    same issue:
    Unity 2020.3.31
    Audience Network Sdk 6.4.0

    Fix:
    I just imported admob sdk 8.3.0, resolved the dependencies, then built and error was gone, then I deleted admob sdk because i'm not using it. Now there are no errors in the build.
     
  17. Miryum

    Miryum

    Joined:
    Jul 25, 2021
    Posts:
    11
    Don't forget to remove resolved libraries then resolve again.
     
  18. nawin_gamedev

    nawin_gamedev

    Joined:
    Sep 11, 2023
    Posts:
    7
    I have got the same issue and struggle a lot by changing Android sdk and JDK versions but after some days, just Enabling use R8 toggle solved my issue but i don't know how....??
     
    Ramigg likes this.
  19. unitytest116

    unitytest116

    Joined:
    Jan 28, 2022
    Posts:
    1
    I deleted the cache file and it worked
    .
     
  20. Cuicui_Studios

    Cuicui_Studios

    Joined:
    May 3, 2014
    Posts:
    72
    Which cache file has to be deleted? In our .gradle folder there's a "caches" folder with lots of stuff. Deleting it's contents does nothing.
    Also, toggling the R8 both on and off does nothing on editor version 2021.3.17f1
     
    Last edited: Jan 2, 2024
    hectorrubio1710 likes this.
  21. RedZAndroidDev

    RedZAndroidDev

    Joined:
    Dec 2, 2016
    Posts:
    7
    This issue is still causing a lot of pain on the latest 2021.3.35f. Should definitely be fixed on the Unity side.
     
  22. Schiznitz3301

    Schiznitz3301

    Joined:
    Apr 29, 2014
    Posts:
    3
    This works for me:
    1, Tick Project Setting/Publish Settings/Custom Gradle properties Template
    2, Modify Assets/Plugins/Android/gradleTemplate.properties, comment out android.enableR8 option, like:
    # android.enableR8=**MINIFY_WITH_R_EIGHT**
     
  23. MosyyabKhan

    MosyyabKhan

    Joined:
    Apr 13, 2021
    Posts:
    2
    try deleting Bee folder in library folder of project in unity 2021