2017-08-31 244 views
6

在启动Android工作室3 beta 2版本中我得到这个消息:Android Studio中3科特林版本

“你在 '科特林-STDLIB-1.1.4-2' 科特林运行的版本库是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'

我试图重建和清洁项目,但没有工作,我仍然可以在启动该消息。

摇篮计划等级:

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 
} 

摇篮应用水平:

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' 
+0

Check here https://stackoverflow.com/questions/43928118/outdated-kotlin-runtime-warning-kotlin-plugin-1-1-2-release-studio2-3-3 –

+0

我已经看到,但已经这正是我所描述的,我做了所有这些。 此外我检查了最新版本https://bintray.com/bintray/jcenter/org.jetbrains.kotlin%3Akotlin-gradle-plugin它说1.1.4-3所以我不明白为什么更新gradle手动赢得' t工作 – fkvestak

回答

2

好吧,因为我去除测试depencencies:

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' 

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

1

有你改变了这个

classpath 'com.android.tools.build:gradle:3.0.0-beta3' 

因为此类路径,我们可以使用科特林版本1.1.4 -3

+0

它已经是3.0.0-beta3,我编辑了这个问题 – fkvestak

+0

你有没有尝试在kotlin中创建另一个项目?它是否给出了同样的错误 – aditya1508

+0

是的,我做了,没有在新项目上的错误,但我删除了测试依赖关系,没有错误 – fkvestak