AndroidStudio gradle7.x 引入华为插件等解决办法

//项目配置
buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
//        maven { url 'https://jitpack.io' }
        maven {
            allowInsecureProtocol = true
            url "http://developer.huawei.com/repo/"
        }


        dependencies {
            classpath 'com.android.tools.build:gradle:7.1.0-alpha08'
            classpath 'com.huawei.agconnect:agcp:1.4.1.300'
        }


    }
}

// module模块
plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'com.huawei.agconnect'
}



//setting.gradle
pluginManagement {


    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()

    }

    plugins {
        id 'com.android.application' version '7.1.0-alpha08'
        id 'com.android.library' version '7.1.0-alpha08'
        id 'org.jetbrains.kotlin.android' version '1.6.0'
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}
rootProject.name = "My Application"
include ':app'

你可能感兴趣的:(Android,Kotlin,华为,android,kotlin)