如何修复库中的此错误(构建gradle)?

问题描述:

显示错误消息,

所有com.android.support库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃).找到版本28.0.0、26.1.0.例子包括com.android.support:animated-vector-drawable:28.0.0和com.android.support:support-media-compat:26.1.0 less ...(Strg + F1)检查信息:库,工具和库的某些组合不兼容或可能导致错误.一种不兼容的情况是使用不是最新版本(或特别是低于targetSdkVersion的版本)的Android支持库版本进行编译.问题ID:GradleCompatible

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-media-compat:26.1.0 less... (Strg+F1) Inspection info:There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion). Issue id: GradleCompatible

更改gradle依赖项

Change your gradle dependency

implementation 'com.android.support:support-media-compat:26.1.0'

implementation 'com.android.support:support-media-compat:28.0.0'