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

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.

It depends on the version of Unity you are using?

  • Check the Unity Console for any additional error messages or warnings that may provide more information about the problem.

  • 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.

  • 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.

  • 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:

  • 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.

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.

3 Likes

Glad to hear its working

But its not working for new builds again

On which version of Unity?

In my case (Unity 2021.3.26) ticking "Use R8" fixed the issue
Player settings > Publishing settings >Minify
9133186--1268116--Capture.PNG

3 Likes

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.

> 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 :u...


> Task :unityLibrary:compileDebugJavaWithJavac FAILED

> Task :launcher:processDebugResources
33 actionable tasks: 14 executed, 19 up-to-date

UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

Error 2

[spoiler]

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.

[/spoiler]

Error 3

[spoiler]

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 :0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[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 :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 :0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :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 :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :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

[/spoiler]

1 Like

[quote=“FeastSC2”, post:8, topic: 913871]
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.

> 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 :u...


> Task :unityLibrary:compileDebugJavaWithJavac FAILED

> Task :launcher:processDebugResources
33 actionable tasks: 14 executed, 19 up-to-date

UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

Error 2

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.

Error 3

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 :0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[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.Action1[T] progress) (at :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 :0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :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 :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :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

[/quote]

Same problem. Did you find the solution?


Unfortunately, I haven't :(

i get the same error and more when i want to add level play ad from IronSource

1 Like

I have been trying to find a solution for two months now, is this a problem in me?

i finally did it, for me it was a problem with androidX this video helped me
https://www.youtube.com/watch?v=ZTgscuf5e6w

1 Like

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.

1 Like

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.

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.


Don't forget to remove resolved libraries then resolve again.

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....??

1 Like


I deleted the cache file and it worked
.


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

1 Like