android - Unresolved reference : kotlinx - Kotlin 1-0-0-rc-1036

标签 android gradle android-gradle-plugin kotlin kotlin-android-extensions

我在 Android 应用程序中工作,几天前我将我的 Kotlin 版本从 1.0.0-beta-1103 更新到候选发布版本 1.0.0-rc-1036 现在我无法为与 Kotlin Android 扩展相关的内容运行我的应用。

我使用apply plugin: 'kotlin-android-extensions' 就像官方博客说的http://blog.jetbrains.com/kotlin/2016/02/kotlin-1-0-release-candidate-is-out/但我的应用无法识别任何布局中的任何 View 。

这是控制台上显示的内容:

Error:(20, 8) Unresolved reference: kotlinx

Error:Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

请帮帮我,我快疯了!

更新:

这是我在 globalbuild.gradle 中的 buildScript

buildscript {
    ext {
        kotlin_version = "1.0.0-rc-1036"
    }
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // The Fabric Gradle plugin uses an open ended version to react
        // quickly to Android tooling updates
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

应用 build.gradle 中列出的依赖项

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // Google
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'

    // Kotlin
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

    // Square
    compile 'com.squareup.okio:okio:1.5.0'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
    compile 'com.squareup.okhttp:okhttp:2.0.0'
    compile 'com.squareup.picasso:picasso:2.5.2'

    // ReactiveX
    compile 'io.reactivex:rxjava:1.0.14'
    compile 'io.reactivex:rxandroid:1.0.1'
    compile 'com.jakewharton.rxbinding:rxbinding:0.3.0'
    compile 'com.jakewharton.rxbinding:rxbinding-support-v4:0.2.0'

    // DBFlow
    kapt 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
    compile "com.raizlabs.android:DBFlow-Core:2.2.1"
    compile "com.raizlabs.android:DBFlow:2.2.1"

    // Otros
    compile 'de.hdodenhof:circleimageview:1.3.0'

    // SQLite Assets Helper
    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'

    // Crashlytics Kit
    compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
        transitive = true
    }
}

这是我正在使用的导入:

import kotlinx.android.synthetic.main.activity_all_quizzes.*

最佳答案

类路径“org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version” 现在应该在项目本地 build.gradle 文件中定义。

关于android - Unresolved reference : kotlinx - Kotlin 1-0-0-rc-1036,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35299825/

相关文章:

android - 在 android 中显示一个 imageview(可见和不可见)三次

java - 如何将一组建议添加到 setSuggestions 中

java - 在 jetty 或 tomcat 中运行嵌入的 vertx 时性能会下降多少?

android - 将 Android Studio 的 Gradle 插件升级到 3.0.1 和 Gradle 到 4.1 后无法复制配置依赖项

android - 适用于 Android 的 Soundcloud SDK

android - 从代码动态更改多个 TextView 的大小(没有 "on disk"xml 主题)?

java - 我如何在 teamcity 上发布 gradle 来发布使用 Maven 插件的 gradle 构建?

gradle - 为什么 kotlin gradle 插件无法使用 1.8 目标构建?

android - Android Studio为每个项目下载不同等级

android - Ionic Cordova 7.1.4 Android 构建失败