找不到id为`kotlin`的插件
我正在使用gradle
并且正在尝试将kotlin
添加到我的项目中。 但是,当我试图添加kotlin
插件gradle
它无法找到它。
apply plugin: 'groovy' apply plugin: 'kotlin' buidscript { ext.kotlin_version = '1.0.1-2' repositories { jcenter() mavenCentral() } dependencies { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.1-2' } } repositories { jcenter() } dependencies { compile 'org.codehaus.groovy:groovy-all:2.4.6' compile 'org.antlr:antlr4:4.5.3' testCompile 'org.spockframework:spock-core:1.0-groovy-2.4' testCompile 'junit:junit:4.12' compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version' }
我得到这个错误
Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'kotlin' not found.
问题是什么?
你有一个错字。 它应该是
buildscript {
而不是 。 buidscript
- 包含gradle脚本kotlin文件的IntelliJ自动完成
- 从cmd运行时,Spring AOP不工作
- Android Studio和Kotlin – 不加载更改
- gRPC gradle:generateProto在导入其他原型定义时找不到目录
- 即使没有任何更改,Android多模块Gradle构建也会很慢
- 使用yeoman生成器Gradle + Kotlin无法生成新项目
- :在Gradle(混合Java + Kotlin项目)中compileKotlin失败
- 错误:执行失败的任务':app:kaptDemoTestingDebugKotlin'
- com.android.tools.build:gradle版本高于2.0.0时,无法在物理设备上运行/部署应用程序