Android Studio 3 Kotlin版

fkv*_*tak 6 android kotlin android-studio android-studio-3.0

在启动Android Studio 3 beta 2时,我收到以下消息:

"你的'kotlin-stdlib-1.1.4-2'库中的Kotlin运行时版本是1.1.4-2,而插件版本是1.1.4-release-Studio3.0-3.应该更新运行时库以避免兼容性问题."

buildscript(项目级别gradle这个)我已经变ext.kotlin_version = '1.1.4-2'ext.kotlin_version = '1.1.4-3'

我尝试重建和清理项目但没有工作,我仍然在开始时得到该消息.

Gradle项目级别:

buildscript {
ext.kotlin_version = '1.1.4-3'
ext.app_compat_version = '26.0.1'
ext.google_play_services = '11.2.0'
ext.firebase_ui_version = '2.1.1'
ext.retrofit_version = '2.3.0'

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-beta3'
    // update kotlin to 1.1.4-2
    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
    classpath 'com.google.gms:google-services:3.1.0'
    classpath ('com.google.firebase:firebase-plugins:1.1.0'){
        exclude group: 'com.google.guava', module: 'guava-jdk5'
    }
}
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)

Gradle app级别:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId ""
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "0.0.1 - Alpha"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    //SUPPORT
    implementation "com.android.support:appcompat-v7:$app_compat_version"
    implementation "com.android.support:design:$app_compat_version"
    implementation "com.android.support:cardview-v7:$app_compat_version"
    //GOOGLE PLAY SERVICES
    compile "com.google.android.gms:play-services-auth:$google_play_services"
    //FIREBASE
    implementation "com.google.firebase:firebase-auth:$google_play_services"
    implementation "com.google.firebase:firebase-database:$google_play_services"
    //FIREBASE UI
    compile "com.firebaseui:firebase-ui-auth:$firebase_ui_version"
    //TRANSITIVE LIBS
    compile "com.android.support:preference-v7:$app_compat_version"
    compile "com.android.support:customtabs:$app_compat_version"
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)

fkv*_*tak 3

好的,因为我删除了测试依赖项:

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
Run Code Online (Sandbox Code Playgroud)

问题解决了,但我不知道为什么,所以不要问我。