[英]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) "我无法将 jitpack 添加到 build.gradle.kts 它显示错误“意外标记(使用';'在同一行上分隔表达式)”
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.对 Kotlin Gradle 脚本的支持在 Android 中是相当新的——例如,ZE84E30B9390CDB64.DB2C9ABZ8 仅在 Studio 版本中添加了支持。 Most of the instructions that you will see online will be for Groovy Gradle scripts, and you will need to make some minor conversions.您将在网上看到的大多数说明将针对 Groovy Gradle 脚本,您需要进行一些小的转换。
In this case, this Groovy:在这种情况下,这个 Groovy:
maven { url "https://jitpack.io" }
...turns into this Kotlin: ...变成这个 Kotlin:
maven { url = uri("https://jitpack.io") }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.