我正试图在我的 Kotlin Android 项目中使用 Anko。我已经按如下方式将 `Anko` 添加到我的依赖项/gradle 模块文件中:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile "org.jetbrains.anko:anko:$anko_version"
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support:support-vector-drawable:26.+'
compile 'com.android.support:support-v4:26.+'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
但是在尝试进行 gradle 同步时,我遇到了以下错误:
Error:(36, 0) Could not get unknown property 'anko_version' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. Open File
如何正确地将 Anko 集成到我的项目中呢?
以 Android Studio 2.0 为参考。