Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin version (1.4.10) is not the same as library version (1.3.72) #3346

Open
luck-apple opened this issue Oct 16, 2020 · 6 comments
Open

Comments

@luck-apple
Copy link

升级 AndroidStudio 4.1,升级 kotlin plugin 1.4.10 后,引入 BaseRecyclerViewAdapterHelper 会有警告:
Plugin version (1.4.10) is not the same as library version (1.3.72)

project build.gradle:

buildscript {
    ext.kotlin_version = "1.4.10"
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.1.0"
        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
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

app build.gradle:

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
    id 'kotlin-kapt'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.1"

    defaultConfig { ... }
    buildTypes { ... }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
    // 这一行会有警告 Plugin version (1.4.10) is not the same as library version (1.3.72) 
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'

    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
}
@bullWing
Copy link

bullWing commented Oct 21, 2020

implementation ('com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'){
exclude group:"org.jetbrains.kotlin", module: "kotlin-stdlib-jdk7"
}
or
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

@luck-apple
Copy link
Author

已解决,谢谢

@TheEngineerProgrammer
Copy link

thanks, i solved it with:
implementation ("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"){
exclude group:"org.jetbrains.kotlin", module: "kotlin-stdlib-jdk7"
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

@0xmarkhernandez
Copy link

thanks, i solved it with:
implementation ("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"){
exclude group:"org.jetbrains.kotlin", module: "kotlin-stdlib-jdk7"
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

You are no longer required to declare dependency in your app level gradle file.
Check Kotlin 1.4.0 Release notes: Dependency on the standard library added by default

@MrCsabaToth
Copy link

thanks, i solved it with:
implementation ("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"){
exclude group:"org.jetbrains.kotlin", module: "kotlin-stdlib-jdk7"
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

You are no longer required to declare dependency in your app level gradle file.
Check Kotlin 1.4.0 Release notes: Dependency on the standard library added by default

Just to be clear: this means that we can just simply remove that implementation line instead of fiddling / hacking with it?

@yuzhiqiang1993
Copy link

不需要再显示的添加kotlin依赖,kotlin会自动添加。kotlin提示Plugin version (1.4.xx) is not the same as library version (1.4.xx) 警告的官方解决办法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants