Есть внешняя библиотека kotlin-stdlib-jre7 1.1.2, которая продолжает ломать мою сборку, я не могу найти библиотеки, которые ее используют
Вот ошибка, которую я получаю:
w: Runtime JAR files in the classpath should have the same version. These
files were found in the classpath:
C:/Users/Yo/.gradle/caches/modules-2/files-
2.1/org.jetbrains.kotlin/kotlin-stdlib-
jdk8/1.3.50/bf65725d4ae2cf00010d84e945fcbc201f590e11/kotlin-stdlib-jdk8-1.3.50.jar (version 1.3)
C:/Users/Yo/.gradle/caches/transforms-2/files-2.1/04f20b503867982c75f45386f3ddefe9/jetified-kotlin-reflect-1.3.50.jar (version 1.3)
C:/Users/Yo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.50/50ad05ea1c2595fb31b800e76db464d08d599af3/kotlin-stdlib-jdk7-1.3.50.jar (version 1.3)
C:/Users/Yo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.1.2-3/8360677e3d1b9bc9716efead9a4e740c428da2ff/kotlin-stdlib-jre7-1.1.2-3.jar (version 1.1)
C:/Users/Yo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.50/b529d1738c7e98bbfa36a4134039528f2ce78ebf/kotlin-stdlib-1.3.50.jar (version 1.3)
C:/Users/Yo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.50/3d9cd3e1bc7b92e95f43d45be3bfbcf38e36ab87/kotlin-stdlib-common-1.3.50.jar (version 1.3)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
w: C:\Users\Yo\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-jre7\1.1.2-3\8360677e3d1b9bc9716efead9a4e740c428da2ff\kotlin-stdlib-jre7-1.1.2-3.jar: kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead
Я провел много исследований этой проблемы, но ни одно из решений не помогло мне
- Я обновил Kotlin до последней версии (из Tools-> Kotlin)
- Я изменил версию Kotlin в сборке на последнюю версию (ext.kotlin_version = '1.3.50')
- Я обновил реализацию Kotlin-stdlib и добавил последнюю версию реализации Kotlin -lect"org.jetbrains.kotlin: kotlin-stdlib-jdk8: $ kotlin_version"
- Изменить совместимость источника и цели в структуре проекта на JdK8
- Я обновил все свои библиотеки, если какая-либо из них все еще былаиспользование устаревшей библиотеки jre
Подробнее:
app / build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// this uses an open-ended version so that the plugin can be updated in response to Android tooling updates
classpath 'io.fabric.tools:gradle:1.25.4'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: "$project.rootDir/tools/app-version-script.gradle"
def getGitCommit() {
def commitCount = 'git rev-list HEAD --count'.execute([], project.rootDir)
return commitCount.text.toInteger()
}
android {
compileSdkVersion 28
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "com.yoyo"
minSdkVersion 16
targetSdkVersion 28
versionName gitVersionName
versionCode getGitCommit()
}
dexOptions {
jumboMode = true
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
def fileName = "YoYo-Debug-${versionName}.apk"
//output.outputFileName = new File(output.outputFile, output.outputFile.name.replace("app-release.apk", fileName)) }
output.outputFileName = new File("./build/", fileName)
}
}
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
def fileName = "YoYo-${versionName}.apk"
output.outputFileName = new File("./build/", fileName)
}
}
}
}
compileOptions {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
}
repositories {
google()
jcenter()
maven { url 'https://maven.google.com'}
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation ('com.google.firebase:firebase-analytics:17.2.0')
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.squareup.okhttp3:okhttp:4.2.2'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
implementation 'com.google.android.gms:play-services-base:17.1.0'
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
transitive = true
}
implementation('com.crashlytics.sdk.android:answers:1.4.7@aar') {
transitive = true
}
implementation 'com.estimote:sdk:1.4.0'
}
apply plugin: 'com.google.gms.google-services'
task wrapper(type: Wrapper) {
gradleVersion "4.1"
}
Уровень проекта build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:4.2.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 {
jcenter()
maven { url "https://maven.google.com" }
google()
}
}
Thanк тебе.