Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0 in android studio

Viewed 1408

I am trying to run my emulator after adding the firebase and google sign in plug ins/dependencies to my gradle.build files and now I am receiving the error "Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0" anyone know if I am doing something wrong this is a react native firebase app.

I am not sure what to try. This is my first app I am doing for a project at school and I do not really know what I am doing. I have just been following tutorials online

3 Answers

Solve this issue by deleting the .gradle folder from <NameOfProject>/android and again run npm run android

I think I just had this same problem. I don't have any idea what your error logs are though so I am not certain however this is my error log right here:

`> Task :react-native-gradle-plugin:compileKotlin FAILED

'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm targeta version. 1 actionable task: 1 executed`

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':react-native-gradle-plugin:compileKotlin'. Failed to query the value of task ':react-native-gradle-plugin:compileKotlin' property 'compilerRun Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilat

This error however I fixed by editing the gradle-wrapper.properties file's distributionUrl variable. I changed the distributionUrls gradle version to 7.4.2 the file is in Project-Name\android\gradle\wrapper\gradle-wrapper.properties

My error log is saying that gradle's version of JVM want's to be version 11 and is not but you can check gradle's jvm version by using cd android in the project root directory and after that run ./gradlew --version Change JVM's version from the version it is showing to the version that it says is required like in my case v 11. The way I changed gradle's JVM version required chocolatey which is a package manager. This is where you can require it https://chocolatey.org/install and after you have setup chocolatey open a new terminal that has administrative privileges and run this choco install -y nodejs-lts openjdk11 with the JVM version it is asking for inside your error logs

and finally run npm start and after that npm run android inside a refreshed and new terminal and gradle's JVM version and gradle's version will be updated to the specified versions

We could better help if you could you show us your android/build.gradle and android/app/build.gradle files, but here are more specific instructions than you find in the docs:

In android/build.gradle, dependencies should look something like this:

    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.1'
        classpath 'com.google.gms:google-services:4.3.10'
        
        classpath("com.android.tools.build:gradle:<version>")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("de.undercouch:gradle-download-task:<version>")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

see: https://github.com/gyani-sunkara/rn-firebase-login-starter/blob/main/android/build.gradle

It is known this works with the classpaths at the beginning.

--

Also in android/app/build.gradle, it is known that the google-services dep works at the end of the file.

apply plugin: 'com.google.gms.google-services'

and make this the last "implementation" under dependencies (around line 272)

implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' // <-- add this; newer versions should work too

see: https://github.com/gyani-sunkara/rn-firebase-login-starter/blob/main/android/app/build.gradle

Then, delete android/.gradle and run npx react-native run-android in the root directory.

Related