Could not find com.android.tools.build:3.6.2:. Required by:

来源:2-2 使用Kotlin编写project-build.gradle

LHgreenbird

2021-11-29

背景介绍: Gradle 5.4.1!
Here are the highlights of this release:

  • Run builds with JDK12

Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant™ version 1.9.13 compiled on July 10 2018
JVM: 13 (Oracle Corporation 13+33)
OS: Windows 10 10.0 amd64
开发工具:AS 3.5.2
编写的代码如下:
build.gradle.kts

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

buildscript {
    val kotlin_version="'1.3.71"
    val gradle_version="3.6.2"
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
        classpath ("com.android.tools.build:$gradle_version")
        classpath ("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")

    }
}

allprojects {
    repositories {
        google()
        jcenter()
        
    }
}
tasks{
    val clean by registering(Delete::class){
        delete(buildDir)
    }
}


sync之后提示

Could not find com.android.tools.build:3.6.2:.
Required by:
    project :
Search in build.gradle files
写回答

1回答

刘某人

2021-12-01

Could not find com.android.tools.build:3.6.2:.

这个可以用

maven { url 'https://maven.aliyun.com/repository/jcenter' }


阿里的镜像


0
0

Kotlin+组件化 打造AI语音助手App 解锁交互技能包

基于百度AI打造一款集WakeUp,TTS,ASR为一体的服务类助手App

219 学习 · 49 问题

查看课程