- Home /
How to remove android.enableR8' from the project
The option 'android.enableR8' is deprecated and should not be used anymore. It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
....Temp\gradleOut\launcher\src\main\AndroidManifest.xml:4:2-98 Warning: uses-permission#android.permission.READ_EXTERNAL_STORAGE was tagged at AndroidManifest.xml:4 to replace another declaration but no other declaration presentTask :unityLibrary:preBuild UP-TO-DATE Task :unityLibrary:preDebugBuild UP-TO-DATE Task :launcher:preBuild UP-TO-DATE Task :launcher:preDebugBuild UP-TO-DATE Task :unityLibrary:compileDebugAidl NO-SOURCE Task :launcher:generateDebugBuildConfig UP-TO-DATE Task :unityLibrary:packageDebugRenderscript NO-SOURCE Task :launcher:compileDebugAidl NO-SOURCE Task :unityLibrary:compileDebugRenderscript NO-SOURCE Task :launcher:compileDebugRenderscript NO-SOURCE Task :launcher:mainApkListPersistenceDebug UP-TO-DATE Task :launcher:generateDebugResValues UP-TO-DATE Task :launcher:generateDebugResources UP-TO-DATE Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE Task :unityLibrary:generateDebugResValues UP-TO-DATE Task :unityLibrary:generateDebugResources UP-TO-DATE Task :launcher:extractDeepLinksDebug UP-TO-DATE Task :launcher:mergeDebugShaders UP-TO-DATE Task :launcher:compileDebugShaders UP-TO-DATE Task :launcher:generateDebugAssets UP-TO-DATE Task :launcher:processDebugJavaRes NO-SOURCE Task :unityLibrary:packageDebugResources UP-TO-DATE Task :unityLibrary:parseDebugLocalResources UP-TO-DATE Task :launcher:checkDebugDuplicateClasses Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE Task :unityLibrary:mergeDebugShaders UP-TO-DATE Task :unityLibrary:compileDebugShaders UP-TO-DATE Task :unityLibrary:generateDebugAssets UP-TO-DATE Task :unityLibrary:packageDebugAssets Task :unityLibrary:processDebugJavaRes NO-SOURCE Task :unityLibrary:bundleLibResDebug UP-TO-DATE Task :unityLibrary:mergeDebugJniLibFolders Task :unityLibrary:processDebugManifest Task :unityLibrary:javaPreCompileDebug Task :unityLibrary:mergeDebugNativeLibs Task :unityLibrary:stripDebugDebugSymbols Task :unityLibrary:copyDebugJniLibsProjectOnly Task :unityLibrary:generateDebugRFile Task :unityLibrary:compileDebugJavaWithJavac Task :unityLibrary:bundleLibRuntimeDebug UP-TO-DATE Task :unityLibrary:bundleLibCompileDebug Task :launcher:mergeDebugResources
Task :launcher:processDebugManifest
39 actionable tasks: 19 executed, 20 up-to-date UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) I am using unity 2020.3.11f i can't build the apk now.Task :launcher:mergeDebugAssets Task :launcher:mergeLibDexDebug UP-TO-DATE Task :launcher:mergeDebugJniLibFolders UP-TO-DATE Task :launcher:javaPreCompileDebug Task :launcher:validateSigningDebug UP-TO-DATE Task :launcher:processDebugResources FAILED Task :launcher:mergeDebugJavaResource Task :launcher:mergeDebugNativeLibs Task :launcher:desugarDebugFileDependencies
Answer by pandaleo · Sep 08, 2021 at 04:39 AM
Hi, I am not sure whether you have same issue as mine, this is the error I get in Console:
'> 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'
But I am able to resolve it and build my apk by follow this link (the website is in Chinese), here is the rough translate:
Tick "Custom Base Gradle Template" in [Project Setting] -> [Player]
Find “baseProjectTemplate.gradle” in your [Project File] -> Assets/Plugins/Android
change: 'com.android.tools.build:gradle:3.6.0' to 'com.android.tools.build:gradle:3.4.0'
There is picture reference at link provided.
Hope this help anyone :)
It's worked for me. Thank you so much! I stuck with the problem for 2 days.
It worked for me, I'm using unity 2020.3.23f1. I did the same change, but from ¨com.android.tools.build:gradle:4.0.1¨ to ¨com.android.tools.build:gradle:3.6.0¨
This fixed every error about gradlebuild that I was having.
Thanks a lot!
Massive thank you everyone, especially ramonemmanuelalvarezsantana2! I was stuck on the same issues for days and have been trawling the internet for answers with no luck. Your suggestion fixed it.
I'm using unity 2020.3.27f1 and changed from ¨com.android.tools.build:gradle:4.0.1¨ to ¨com.android.tools.build:gradle:3.6.0¨
This fixed every error I was having too.
Thanks for making my Unity life that bit easier!
I honestly had to login just to say THANK YOU This was driving me crazy and I couldn't find ANYTHING on how to fix it!
How did you manage to run across this fix on a Chinese site?
Answer by -chris · Oct 26, 2021 at 10:43 PM
I was getting the "'android.enableR8' is deprecated" error when targeting API level 31.
Resolved by setting "Target API Level" to "Android 11.0 (API level 30)":
Unity 2020.3.9f1
Did not work for me. which gradle version you are using sir?
Answer by atulvi · Nov 21, 2021 at 06:52 PM
Step 01 : Install GoogleMobileAds plugin and setup and Asset > External Dependency Manager > Android Resolver > resolve. [Optional]
Step 02 : Set Target API Level 30 in Player Setting.
Step 03 : Tick in Custom Main Gradle Template and Custom Launcher Gradle Template.
G02.PNG
Step 04: How mainTemplate and launcherTemplate files generating. [If not view then first build ignore the errors]
G03.PNG link Image
Step 05 : Added below code into mainTemplate.gradle file with your favorite editor.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
// Must be Android Gradle Plugin 3.6.0 or later. For a list of
// compatible Gradle versions refer to:
// https://developer.android.com/studio/releases/gradle-plugin
classpath 'com.android.tools.build:gradle:3.6.0'
}
}
allprojects {
repositories {
google()
mavenCentral()
flatDir {
dirs 'libs'
}
}
}
//Look like that G04.PNG link Image
Step 06 : Download Gradle gradle-5.6.4-all.zip from grdale.org. Download from https://services.gradle.org/distributions/
After download extract the file and set gradle path into Edit > Preference > External Tools > Gradle Install with Unity(recommended) UnChecked
G05.PNG link Image
Step 07 : Build
Helpful Link : https://developers.google.com/ar/develop/unity-arf/android-11-build
Answer by MrKocurrr · Oct 01, 2021 at 02:29 PM
In my case, building for the Oculus Quest 2, it helped to switch from il2cpp to mono, build and than swtich again and it was working perfectly. Unity 2020.3.18f1.
This was the easiest solution , Thanks so much.
I was using Vuforia and was running on mono it worked, but after adding Google sign-in and adding keystore it started to show this message.
Then i read this comment after trying several tricks and i changed to IL2CPP and it worked without any errors.
Answer by Miryum · Jan 16 at 09:58 AM
I had the same problem, I tried some solutions above and did not work for me. I gave up and I turned off my computer. Next day I tried to build and it worked like nothing was wrong.