Gradle error : Could not find com.android.tools.build:gradle:2.2.3

前端 未结 13 1328
盖世英雄少女心
盖世英雄少女心 2020-12-05 09:44

I\'m trying to build my android project using gradle and circleCI, but I\'ve got this error :

* What went wrong:
  A problem occurred configuring root projec         


        
相关标签:
13条回答
  • 2020-12-05 10:16

    Reading sembozdemir answer in this post I have resolved a similar problem adding jcenter() in build.gradle (module: cordovaLib)

    buildscript {
        repositories {
            mavenCentral()
            jcenter()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:2.2.3'
        }
    
    }
    
    0 讨论(0)
  • 2020-12-05 10:18

    On my side I got the same issue because I used the wrong order of repositories.

    google() should be added before jcenter()

    buildscript {
        repositories {
            google()
            jcenter()
        }
    
    0 讨论(0)
  • 2020-12-05 10:19

    Do you try it

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.2.2'
    
            // NOTE: Do not place your application dependencies here; they belong
        }
    
    }
    
    allprojects {
        repositories {
            jcenter()
            maven {
                url "https://jitpack.io"
            }
            flatDir {
                dirs 'libs'
            }
    
        }
    
    }
    

    and Build->Clear Project

    0 讨论(0)
  • 2020-12-05 10:19

    Try this:

    allprojects {
        buildscript {
            repositories {
                maven {
                    url "https://dl.bintray.com/android/android-tools"
                }
            }
        }
    ...
    }
    
    0 讨论(0)
  • 2020-12-05 10:20

    Add jcenter in your project gradle file and sync

    0 讨论(0)
  • 2020-12-05 10:25

    After the recent update to Android Studio 3.0 Canary 1, I got the following error:

    > Could not resolve all dependencies for configuration ':classpath'.
       > Could not find com.android.tools.build:gradle:3.0.0-alpha1.
         Searched in the following locations:
             https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.pom
             https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.jar
         Required by:
             project :
    

    Here is what I had to add (to the project-level build.gradle):

    buildscript {
        repositories {
            maven {
                url 'https://maven.google.com'
            }
            ....            
        }
    

    Found here: https://developer.android.com/studio/preview/features/new-android-plugin-migration.html

    0 讨论(0)
提交回复
热议问题