无法将Kotlin Android扩展程序添加到我的项目中

当我尝试通过以下方式添加kotlin-android-extensions:

apply plugin: 'kotlin-android-extensions'

到我的项目Android Studio告诉我插件’kotlin-android-extensions not found?

出了什么问题? 我正在运行Android Studio 3.0 Canary 8

你们都做得很好,但是你必须把插件ID添加到你的gradle文件中的依赖类路径中

 buildscript { ext.kotlin_version = '1.1.60' repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } 

你总是不得不添加,做完这些后,在你的gradle(app)文件中添加如下内容

 compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 

你们都完成了

糟糕! 我忘了添加这里提到的kotlin gradle插件: https ://kotlinlang.org/docs/reference/using-gradle.html#plugin-and-versions

我认为这是所有关于订购,确保你有这样的应用插件订单

 apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'realm-android'