简体   繁体   English

支持库必须使用compileSdkVersion 28的确切版本规范错误

[英]Support libraries must use the exact version specification error with compileSdkVersion 28

After updating compileSdkVersion from 27 to 28 and updateing support libraries from 27.1.1 to 28.0.0 I got this warning message in Android Studio 3.2: 将compileSdkVersion从27更新到28并将支持库从27.1.1更新到28.0.0后,我在Android Studio 3.2中收到此警告消息:

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). 所有com.android.support库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。 Found versions 28.0.0, 26.1.0. 找到的版本28.0.0,26.1.0。 Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-v4:26.1.0 示例包括com.android.support:animated-vector-drawable:28.0.0com.android.support:support-v4:26.1.0

My Gradle: 我的Gradle:

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    // Für Google "Mobile Vision" API
    implementation 'com.google.android.gms:play-services-vision:15.0.2'

    // wird nicht weiterentwickelt
    implementation 'com.edwardvanraak:MaterialBarcodeScanner:0.0.6-ALPHA'

    // für Butter Knife
    // https://github.com/JakeWharton/butterknife
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    implementation 'com.jakewharton:butterknife:8.8.1'

    // Logging nur im Debug Modus
    // https://github.com/JakeWharton/timber
    implementation 'com.jakewharton.timber:timber:4.7.1'

    // Für Material Dialogs
    // https://github.com/afollestad/material-dialogs
    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'

    // Google support library
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:animated-vector-drawable:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-media-compat:28.0.0'

    implementation 'commons-io:commons-io:2.6'
    implementation 'com.google.code.gson:gson:2.8.2'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

If I run the app, I received this error in the line setContentView(R.layout.activity_main); 如果我运行应用程序,我在行setContentView(R.layout.activity_main)中收到此错误;

Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
2018-09-26 15:03:49.987 21534-21534/com.timeshuttle.lagerapp I/zygote64:     at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2018-09-26 15:03:49.987 21534-21534/com.timeshuttle.lagerapp I/zygote64:     

How do I proceeed to resolve this problem? 我该如何解决这个问题?

When I add the line 当我添加该行

implementation 'com.android.support:support-v4:28.0.0' 

the warning disappears, but the app still fails to start (same error message) 警告消失,但应用程序仍然无法启动(相同的错误消息)


update 更新

When I revert to 27.1.1, the version conflict warning does not appear. 当我恢复到27.1.1时,不会出现版本冲突警告。 The warning only appears with 28.0.0. 该警告仅出现在28.0.0中。 Should I reorder the dependecies? 我应该重新安排家属吗?

您的一些依赖项仍然使用com.android.support:support-v4:26.1.0 ,因此您需要更新依赖项或使用旧的支持库版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 android.support 库必须使用完全相同的版本规范 - android.support libraries must use the exact same version specification 清单错误-所有com.android.support库都必须使用完全相同的版本规范 - Error in manifest - All com.android.support libraries must use the exact same version specification 所有com.android.support库都必须使用完全相同的版本规范gradle错误 - All com.android.support libraries must use the exact same version specification gradle error Android gradle错误:所有com.android.support库都必须使用完全相同的版本规范吗? - Android gradle error: All com.android.support libraries must use the exact same version specification? 构建APK“库必须使用完全相同的版本规范”时出错 - Error building apk 'libraries must use the exact same version specification' 尽管使用相同版本,所有com.android.support库都必须使用完全相同的版本规范 - All com.android.support libraries must use the exact same version specification although using same version Android Studio:“所有com.android.support库都必须使用完全相同的版本规范” - Android studio: “All com.android.support libraries must use the exact same version specification ” Android Studio - gradle 警告:所有 com.android.support 库必须使用完全相同的版本规范 - Android Studio - gradle warning: All com.android.support libraries must use the exact same version specification 所有 com.android.support 库必须使用 firebase 使用完全相同的版本规范 - All com.android.support libraries must use the exact same version specification using firebase 所有com.android.support库必须使用完全相同的版本规范:27.0.2 - All com.android.support libraries must use the exact same version specification : 27.0.2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM