How to deal with deprecated gradle features were used in this build, making it incompatible with gradle 8.0

How to deal with deprecated gradle features were used in this build, making it incompatible with gradle 8.0

Kyle Elkins Author: Kyle Elkins Date: 2022-08-09
How to deal with deprecated gradle features were used in this build, making it incompatible with gradle 8.0

    1. FAILURE
    2. Sometime when you try to build the app you may encounter this FAILURE.
      ..."Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0."
      

    3. Most common Solution
    4. Run the Gradle build with a command line argument --warning-mode=all to see what exactly the deprecated features are.

      It will give you a detailed description of found issues with links to the Gradle docs for instructions how to fix your build.

      Adding --stacktrace to that, you will also be able to pinpoint where the warning comes from, if it's triggered by outdated code in one of the plugins and not your build script.

    5. Solution 2
    6. if the abouve Solution dont work Try this one

      cd android && ./gradlew clean && ./gradlew :app:bundleRelease
      

    7. Solution 3
    8. The process below worked in many case- First check Gradle Version:

      cd android
      ./gradlew -v
      

      In my case it was 6.5

      Go to https://developer.android.com/studio/releases/gradle-plugin and you'll get the plugin version for your gradle version. For gradle version 6.5, the plugin version is 4.1.0

      Then go to app/build.gradle and change classpath 'com.android.tools.build:gradle:<plugin_version>

    9. Solution 4
    10. if your project is incompatible with Gradle 8.0 .Here's what worked for you: First write this line of code in the Android Studio terminal:

      ./gradlew build --warning-mode all
      

      When you do that, you will be shown in the logcat what is found to be deprecated or an issue in your project, for me it was the jcenter() repository that needed to be removed in my settings.gradle file and also I needed to update classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21" to classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30" in my build.gradle project file.

      Once I did these things, my project built perfectly and installed on my emulator