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