gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 14:38:16 24 4
gpt4 key购买 nike

将 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). Found versions 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

我的 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'
}

如果我运行该应用程序,我会在 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:

我该如何继续解决这个问题?

当我添加行时

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

警告消失,但应用仍然无法启动(同样的错误信息)


更新

当我恢复到 27.1.1 时,版本冲突警告没有出现。该警告仅出现在 28.0.0 中。我应该重新排序依赖项吗?

最佳答案

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

关于android - 支持库必须使用 compileSdkVersion 28 的确切版本规范错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52518488/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com