Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

build.gradle: The option 'android.enableR8' is deprecated and should not be used anymore

Tags:

I am new to flutter development.

When I opened my android project in android studio then I got this warning and unable to understand exactly what to do?

I have already read this but not clear to me.

Please tell exactly what to do? (Keep in mind I am new to flutter so be stepwise.)

like image 866
Abhishek Kumar Avatar asked Mar 06 '20 06:03

Abhishek Kumar


People also ask

Is R8 enabled by default?

Android release. In the current Android Studio preview, R8 is enabled by default.

What is Gradle build in unity?

Gradle is an Android build system that automates a number of build processes and prevents many common build errors. In Unity, Gradle reduces the method reference count in DEX (Dalvik Executable format) files, which means you are less likely to come across DEX limit problems. Unity uses Gradle for all Android builds.

Is proguard deprecated?

For example, the useProGuard setting has been deprecated a while ago - maybe that's what you saw and you're misremembering it.


2 Answers

Step 1:

Open the gradle.properties file

**Android Studio File Structure**

Step 2:

Disable android.enableR8=true by adding a # in front:

#android.enableR8=true

Alternatively, you can swap out the R8 for D8, The build system changed to using D8 instead of R8.

android.enableD8=true

like image 135
duanduan Avatar answered Sep 24 '22 00:09

duanduan


For me, after spending a whole day on it, I solved it by downgrading to JDK 8 and I have previously tried it with embedded JDK and JDK 16.

like image 36
Tauqeer Ahmed Khattak Avatar answered Sep 22 '22 00:09

Tauqeer Ahmed Khattak