Solve Could not find org.jetbrains.kotlin: kotlin-gradle-plugin * error method

The main reason for this error is that there is no suitable package in the current warehouse, just add the domestic maven source, the specific method is as follows:

Add the following domestic mirror warehouses in Gradle Scripts->build.gradle, pay attention to both places:

maven {

            url 'https://maven.aliyun.com/repository/google'

        }

        maven {

            url 'https://maven.aliyun.com/repository/public'

        }

        maven {

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

        }

All code:

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

buildscript {

//    ext.kotlin_version = '1.3.72'

    ext.kotlin_version = "1.5.0"

    repositories {

        maven {

            url 'https://maven.aliyun.com/repository/google'

        }

        maven {

            url 'https://maven.aliyun.com/repository/public'

        }

        maven {

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

        }

        google()

//        jcenter()

    }

    dependencies {



        // 4.1.0-alpha10 or above and Android Studio 4.1 Canary 10 or above is required for

        // TensorFlow Lite / Machine Learning (ML) binding

        classpath 'com.android.tools.build:gradle:4.2.1'

        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"



    }

}



allprojects {

    repositories {

        maven {

            url 'https://maven.aliyun.com/repository/google'

        }

        maven {

            url 'https://maven.aliyun.com/repository/public'

        }

        maven {

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

        }



        google()

//        jcenter()

    }

}

Guess you like

Origin blog.csdn.net/qq_18256855/article/details/127137488