【问题标题】:Could not find com.android.tools.build:gradle-core:3.0.0-alpha5找不到 com.android.tools.build:gradle-core:3.0.0-alpha5
【发布时间】:2025-11-28 17:00:02
【问题描述】:

我收到了这个错误

错误:找不到 com.android.tools.build:gradle-core:3.0.0-alpha5。 在以下位置搜索: 文件:/C:/Program Files/Android/android-studio-3/gradle/m2repository/com/android/tools/build/gradle-core/3.0.0-alpha5/gradle-core-3.0.0-alpha5.pom 文件:/C:/Program Files/Android/android-studio-3/gradle/m2repository/com/android/tools/build/gradle-core/3.0.0-alpha5/gradle-core-3.0.0-alpha5.jar https://jcenter.bintray.com/com/android/tools/build/gradle-core/3.0.0-alpha5/gradle-core-3.0.0-alpha5.pom https://jcenter.bintray.com/com/android/tools/build/gradle-core/3.0.0-alpha5/gradle-core-3.0.0-alpha5.jar 要求: 项目:> com.android.tools.build:gradle:3.0.0-alpha5

我的毕业典礼

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '25.0.3'
defaultConfig {
    applicationId "com.the360ls.a360"
    minSdkVersion 19
    targetSdkVersion 26
    versionCode 10
    versionName "0.8.1e"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
    signingConfig signingConfigs.config
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config
    }
    debug {
        signingConfig signingConfigs.config
    }
}
buildscript {
    repositories {
        jcenter()
        maven { url 'https://dl.google.com/dl/android/maven2' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha6'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://raw.github.com/Tpaga/tpaga-android-sdk/releases"
        }
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0-beta2'
compile 'com.android.support:design:26.0.0-beta2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.android.support:cardview-v7:26.0.0-beta2'
compile 'com.android.support:recyclerview-v7:26.0.0-beta2'
compile 'com.android.support:support-vector-drawable:26.0.0-beta2'
compile 'com.android.support:support-v4:26.0.0-beta2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-database:11.0.2'
compile 'com.google.android.gms:play-services-maps:11.0.2'
compile 'com.google.android.gms:play-services-location:11.0.2'
testCompile 'junit:junit:4.12'
compile 'co.tpaga:android:1.0.0'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
}

apply plugin: 'com.google.gms.google-services'

我不知道如何解决它,我正在尝试一切

【问题讨论】:

  • 仅供参考,您可能不想显示您应用的签名信息
  • 谢谢...我太菜鸟了

标签: android maven


【解决方案1】:
  1. 更改依赖项

    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
    }
    
  2. 更改gradle-wrapper.properties

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

【讨论】:

    【解决方案2】:

    改变

    1. “build.gradle”中的依赖项与现有最新版本的 android studio
    2. 将 gradle-wrapper.properties 中的“distributionUrl”更改为最新版本

    我的版本是“Android Studio 3.0 Canary 7”,我的改动如下

    1.依赖{

        classpath 'com.android.tools.build:gradle:3.0.0-alpha7'
    

    }

    2。 distributionUrl=https://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip

    【讨论】: