小编Ibr*_*nam的帖子

Gradle 同步失败:不支持在没有明确选择加入的情况下对存储库使用不安全的协议。切换 Maven 存储库

每当我打开 android studio 时,Gradle 同步都会失败。这是我的 gradle.build 文件。有人可以告诉我如何解决这个问题吗?我安装了 gradle 7.2。但我无法弄清楚是什么导致了这个问题..我什至尝试过allowInsecureProtocol = true

gradle.build/android

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        googlePlayServicesAuthVersion="16.0.1"
    }
    repositories {
        
        google()
        mavenCentral(){
        allowInsecureProtocol = true
    }
        maven{
             url 'https://maven.google.com/'
            name 'Google'
             
        }
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.3.3'
        classpath("com.android.tools.build:gradle:4.2.0")

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module …
Run Code Online (Sandbox Code Playgroud)

android gradle android-studio reactjs react-native

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

android-studio ×1

gradle ×1

react-native ×1

reactjs ×1