Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails, Could not resolve gradle files #532

Closed
engr-Eghbali opened this issue Oct 31, 2018 · 2 comments
Closed

build fails, Could not resolve gradle files #532

engr-Eghbali opened this issue Oct 31, 2018 · 2 comments
Labels

Comments

@engr-Eghbali
Copy link

engr-Eghbali commented Oct 31, 2018

summary:
My cordova android project build failed with error like

Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar

while I can download these files in my browser and I have not any proxy conf in gradle.

I tried:
reinstalling gradle.
reinstalling android studio and build tools.
reinstalling cordova.
modify repositories in build.gradle to google(),maven(),jcenter and etc.
removing gradle cache folder.
reinstalling windows and installing all packages and stuffs from the beginning!
and many trick from stackOverflow and other websites.

my env:

windows 10
android studio 3.2.1
cordova 8.1.2 (cordova-lib@8.1.1)
gradle 4.6
jdk 1.8

inside build.gradle:

buildscript {
repositories {
google()
maven {
url "https://dl.google.com/dl/android/maven2"
}
// jcenter()
}
dependencies {

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.android.tools.build:gradle:3.0.1'
}

}

allprojects {
repositories {
google()
maven {
url "https://dl.google.com/dl/android/maven2"
}
// jcenter()
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="27.0.1" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

@brodycj brodycj added the support label Nov 9, 2018
@brodycj
Copy link
Contributor

brodycj commented Nov 9, 2018

I suggest you post a mvce ([1]) project that demonstrates this issue.

[1] https://stackoverflow.com/help/mcve

@breautek
Copy link
Contributor

Closing due to inactivity.

If the problem persists, I recommend ensuring that everything is up to date, including your android SDK installation & SDK tooling.

If you think you've found an issue with cordova, feel free to open a new issue and please fill out all the information requested.

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

No branches or pull requests

3 participants