简体   繁体   中英

Could not find com.android.tools.build:gradle:3.2.1. in a sample project from github

I am trying to compile this project: https://github.com/dakatso/SpeexExample

The project as is gives errors during gradle sync (it says something called mipsel-linux-android was not found). I have made changes to the following files:

gradle-wrapper.properties:

#Tue Jul 07 16:26:18 KST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-all.zip  

Project level build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        // classpath 'com.android.tools.build:gradle-experimental:0.7.2'        // ORIGINAL
        classpath 'com.android.tools.build:gradle:3.2.1'
        // classpath 'com.android.tools.build:gradle:4.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

Could not find com.android.tools.build:gradle:3.2.1.
Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.jar
Required by:
    project :
Add Google Maven repository and sync project
Open File

If I create a new project from scratch I use 'com.android.tools.build:gradle:4.0.0' but for this project nothing seems to work. How can I get this project to compile?

You have to add the google() repo.

buildscript {
    repositories {
        google() //<--
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        // classpath 'com.android.tools.build:gradle:4.0.0'
    }
}

allprojects {
    repositories {
        google() //<--
        jcenter()
    }
}

Also check the gradle version.
The plugin 3.2.1 requires at least the version 4.6:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM