'The project uses Gradle 2.10 which is incompatible with Android Studio 2020.3

heyy,, while learning android studio from udacity they asked me to download a project from there github link and I did so ..but while I was importing it to android studio I got an error message of - The project uses Gradle 2.10 which is incompatible with Android Studio 2020.3. .I tried some of the solution it just gives more and more error with every solution ..i saw another same question here but no one replied to it do it thought of reposting it ...actually the code on github is verry old for refrence it was published on 2017 ...pls help me ...this is the link to the github code -https://github.com/udacity/ud843-QuakeReport



Solution 1:[1]

If you did not figure this out yet, I am just starting the same project too. I changed the classpath like above. I then found a website to use the latest version of gradle and the plugin. It says "You can specify the Gradle version in either the File > Project Structure > Project menu in Android Studio, or by editing the Gradle distribution reference in the gradle/wrapper/gradle-wrapper.properties file." I did the first one.

Then, I got errors for both build.gradle files in the project and app version. I get this error: Could not find com.android.tools.build:gradle:7.0.3

If you get this error, click the link "Add google Maven repository and sync project". Then you have to click "Do refactor".

Now you come across another error in one of the build.grade files. This stackoverflow link will tell you: Gradle - Error Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]

Finally, replace testCompile with testImplementation and then you should get BUILD SUCCESSFUL.

Solution 2:[2]

The project's Gradle version you're trying to clone is outdated. Change it based on your android studio version.

on your build.gradle(Project) change the version and sync

classpath "com.android.tools.build:gradle:4.1.2"

Solution 3:[3]

If not getting any solution, the best you can do is copy the "app" folder of your project(using file explorer) and paste it in a newly created project(should be of same name as of your project), in that way you'll get already synced gradle and newly created version of your app. Because, every important thing in your project is present in its app folder and when you create a new project with same name and copy app folder from your older version of your project, you will have a newer version of your project with all same resources. Note: You can't move through branches and other commits

Solution 4:[4]

Got the solution :)

In gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

In build.gradle project level:

buildscript {
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:7.0.4'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

In build.gradle module level:

Replace all "compile" with "Implementation" and do other suggested version updated and you are done here :)

Hope this works for you, if yes just press that up button :)

Solution 5:[5]

I saw this issue several times with Android studio. Below trick worked me the best.

  1. Android Studio suggests to upgrade to newer version, please upgrade it and let it sync
  2. Mostly you would see error message again
  3. Now, Go to File -> Invalidate Caches/Restart
  4. It should work now

If it shows same error then I don't know what to do. If it shows different error then repeat from step 1 to 3 for new error.

Hope, it helps some..

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Patrick
Solution 3
Solution 4 Sagar Malhotra
Solution 5 Sreenu Yatam