首页 > 其他分享 >Android编译报错:Cannot resolve external dependency com.android.tools.build:gradle:7.3.0 because no repos

Android编译报错:Cannot resolve external dependency com.android.tools.build:gradle:7.3.0 because no repos

时间:2022-10-24 22:00:19浏览次数:77  
标签:resolve aliyun repository url maven 7.3 报错 https com

修改根目录的build.gradle 增加 repositories 配置,然后再File>Sync Project with Gradle Files,再执行Build>Rebuild Project

buildscript {
    ext {
        agp_version = '7.3.0'
    }
    repositories {
        maven { url "https://jitpack.io" }
        maven { url 'https://maven.aliyun.com/repository/releases' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/central' }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.0'
    }
}// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

  

标签:resolve,aliyun,repository,url,maven,7.3,报错,https,com
From: https://www.cnblogs.com/xsj1989/p/16823170.html

相关文章