Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

gradle problem #5

Open
SaraAshourHelmy opened this issue Sep 5, 2017 · 9 comments
Open

gradle problem #5

SaraAshourHelmy opened this issue Sep 5, 2017 · 9 comments

Comments

@SaraAshourHelmy
Copy link

I found this message :
Error:Could not find com.android.tools.build:gradle:2.2.0.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.jar
Required by:
project :XYZReader

what shall i do ??

@CarloAntonio
Copy link

I'm getting the same error as saraashour89.

Error:Could not find com.android.tools.build:gradle:2.2.0.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.jar
Required by:
project :XYZReader

@CarloAntonio
Copy link

CarloAntonio commented Sep 26, 2017

I found the solution on the Udacity forums. But just in case someone else runs into the same problem. You need to change the project level build.gradle file. change the depenencies class path Gradle version to the current version you are running. You should see your current version at the top bar of android studio. Good luck!

@rahulgrover9669
Copy link

You should Gradle version in your app according to installed version of Gradle in your system

@CarolineClark
Copy link

I think it's a problem with the gradle wrapper? For example, I don't think XYZReader/gradlew should even exist...

@CarolineClark
Copy link

Can someone test this PR? It seems to work for me, but I don't know if that's because I actually fixed the gradle wrapper.
#11

@Ashl7
Copy link

Ashl7 commented Jan 5, 2018

@miki995
Copy link

miki995 commented Apr 1, 2018

Hey, guys,
You should check gradle series in udacity courses, they have one course specially made for improting old gradle projects into android studio....
Ideally you can fix:

  • Gradle wrapper version
  • General build.gradle version
  • In app module, build.gradle dependencies and sdk.
    That should resolve problems. 🗡️
    Regards

@wise4rmgod
Copy link

Thanks guys,You saved my day

@Tiam-Abderezai
Copy link

Tiam-Abderezai commented Jun 1, 2020

@saraashour89

If you're having trouble starting the XYZ-Reader project, do the following:

  1. Update the "distributionUrl" attribute in your gradle-wrapper.properties file to 5.6.4:

  2. Make sure the "classpath" version in your build.gradle module and project match. (mine is 3.6.2 for both of them)

  3. Replace the contents of your build.gradle file with the following:

buildscript {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.2'
    }
}
apply plugin: 'com.android.application'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 25
    }
}

dependencies {
    implementation "com.android.support:support-v4:$androidSupportVersion"
    implementation "com.android.support:support-v13:$androidSupportVersion"
    implementation "com.android.support:appcompat-v7:$androidSupportVersion"
    implementation "com.android.support:palette-v7:$androidSupportVersion"
    implementation "com.android.support:recyclerview-v7:$androidSupportVersion"
    implementation "com.android.support:cardview-v7:$androidSupportVersion"
    implementation 'com.squareup.okhttp3:okhttp:3.1.2'
    implementation files('libs/volley.jar')
}

  • You may run into an issue where your NDK is missing. Simply go to :
    File>Project Structure> SDK Location > Download Android NDK.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants