简体   繁体   中英

Unexpected tokens (use ';' to separate expressions on the same line) in build.gradle.kts

这是错误消息的屏幕截图

I can't add jitpack to build.gradle.kts it shows an error " Unexpected tokens (use ';' to separate expressions on the same line) "

allprojects {
repositories {
    google()
    jcenter()
    maven { url "https://jitpack.io" }
}

}

Support for Kotlin Gradle scripts is fairly new in Android — for example, Android Studio only added support for it in version 4.0. Most of the instructions that you will see online will be for Groovy Gradle scripts, and you will need to make some minor conversions.

In this case, this Groovy:

maven { url "https://jitpack.io" }

...turns into this Kotlin:

maven { url = uri("https://jitpack.io") }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM