Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3 Kotlin version

On start Android Studio 3 beta 2 i get this message:

"Your version of Kotlin runtime in 'kotlin-stdlib-1.1.4-2' library is 1.1.4-2, while plugin version is 1.1.4-release-Studio3.0-3. Runtime library should be updated to avoid compatibility problems."

In buildscript (project level gradle) I already changed ext.kotlin_version = '1.1.4-2' to ext.kotlin_version = '1.1.4-3'

I tried rebuilding and cleaning the project but none works, i still get that message on start.

Gradle project level:

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
}

Gradle app level:

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'
like image 723
fkvestak Avatar asked Aug 31 '17 12:08

fkvestak


2 Answers

Ok since i removed test 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'

problem is gone, but i don't know why so don't ask me.

like image 191
fkvestak Avatar answered Sep 30 '22 21:09

fkvestak


have you changed this

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

because with this classpath we can use kotlin-version 1.1.4-3

like image 39
neo73 Avatar answered Sep 30 '22 20:09

neo73