Android接入第三方库踩过的坑-兼容性问题解决汇总

1,058 阅读7分钟

接入第三方库时遇到一些兼容性问题,总结汇总如下:

1、SDK最低支持版本冲突

编译时,Android Studio控制台报如下异常:

Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [:upgrade-1.0.11:] C:\Users\heiyulong\.gradle\caches\transforms-2\files-2.1\b00ccd2adbc43657c326c62176fbea22\jetified-upgrade-1.0.11\AndroidManifest.xml as the library might be using APIs not available in 21
	Suggestion: use a compatible library with a minSdk of at most 21,
		or increase this project's minSdk version to at least 23,
		or use tools:overrideLibrary="com.vector.update_app" to force usage (may lead to runtime failures)

如上错误信息,可以得知编译报错的原因以及三种解决方案:

错误原因:

Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [:upgrade-1.0.11:]

引入的第三方库 [:upgrade-1.0.11:]最低支持版本为23高于我的项目的最低支持版本21,所以抛出了这个异常。

解决方案:

方案1:

Suggestion: use a compatible library with a minSdk of at most 21

修改你所引入的第三方库的最低支持版本,确保和自己项目的最低版本保持一致。

++但是,如果你所引入的第三方库没有源码,并非开源的时,该方案就无法执行了++

方案2:

or increase this project's minSdk version to at least 23,

修改自己主项目的最低支持版本和第三方库的最低支持版本保持一致。

但是,该方案可能不是我们想要的,因为我们想要兼容更低的版本++。++

apply plugin: 'android'

android {
    compileSdkVersion 21
    buildToolsVersion "30.0.0"

    defaultConfig {
        applicationId "com.test.app"
        // 修改最低SDK支持版本
        minSdkVersion 23
        targetSdkVersion 30
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
方案3:

如果不想修改自己主项目的最低支持版本,也无法修改第三方库的最低支持版本时,可以参看如下方案

or use tools:overrideLibrary="com.vector.update_app" to force usage

在AndroidManifest.xml文件中 标签中添加

<uses-sdk tools:overrideLibrary="com.vector.update_app/>

其中的com.vector.update_app为第三方库包名,如果存在多个库有此异常,则用逗号分割它们,例如:

<uses-sdk tools:overrideLibrary="com.vector.update_app, xxx.xxx.xxx"/>

这样项目中的AndroidManifest.xml和第三方库的AndroidManifest.xml合并时可以忽略最低版本限制。

  • to force usage (may lead to runtime failures)

但是方案都可能导致运行时错误,因为运行第三库时没有兼容SDK为23以下的版本,导致运行时异常,最好是兼容统一最低版本的支持。

2、FileProvider冲突适配

接入第三方库后,Android Studio编译异常,控制台错误信息如下:

> Task :app:processDevDebugManifest FAILED
D:\project\test\android\app\src\main\AndroidManifest.xml:44:13-59 Error:
	Attribute provider#androidx.core.content.FileProvider@authorities value=(com.test.app.FileProvider) from AndroidManifest.xml:44:13-59
	is also present at [:thirdsdk-3.1.4:] AndroidManifest.xml:41:13-65 value=(com.test.app.file.provider).
	Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:42:9-51:20 to override.
D:\project\test\android\app\src\main\AndroidManifest.xml:50:17-50 Error:
	Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/filepaths) from AndroidManifest.xml:50:17-50
	is also present at [:thirdsdk-3.1.4:] AndroidManifest.xml:46:17-58 value=(@xml/sdk_file_provider).
	Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml:48:13-50:53 to override.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.


Execution failed for task ':app:processDevDebugManifest'.
> Manifest merger failed with multiple errors, see logs

错误原因:

根据错误日志分析,出现的原因是因为引入的第三方库的清单文件里也添加了provider这段代码,导致了冲突。 如下是自己项目中provider的配置:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${packName}.FileProvider"
    android:exported="false"
    android:grantUriPermissions="true">

    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/filepaths" />
</provider>

解决方案:

添加如下代码到

tools:replace="android:authorities"

添加如下代码到

tools:replace="android:resource"

添加后代码如下:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${packName}.FileProvider"
    android:exported="false"
    tools:replace="android:authorities"
    android:grantUriPermissions="true">

    <meta-data
        tools:replace="android:resource"
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/filepaths" />
</provider>

3、依赖库版本冲突

接入新的第三方平台SDK后,编译运行时发现如下错误:

> Task :app:processDevDebugResources FAILED
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml","position":{"startLine":1}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml:2: AAPT: error: resource dimen/md_title_frame_margin_bottom (aka com.test.app:dimen/md_title_frame_margin_bottom) not found.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml","position":{"startLine":16}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml:17: AAPT: error: resource dimen/md_title_frame_margin_bottom (aka com.test.app:dimen/md_title_frame_margin_bottom) not found.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml","position":{"startLine":47}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml:48: AAPT: error: resource dimen/md_title_frame_margin_bottom (aka com.test.app:dimen/md_title_frame_margin_bottom) not found.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml","position":{"startLine":69}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml:70: AAPT: error: resource dimen/md_title_frame_margin_bottom (aka com.test.app:dimen/md_title_frame_margin_bottom) not found.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml","position":{"startLine":113}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml:114: AAPT: error: resource dimen/md_title_frame_margin_bottom (aka com.test.app:dimen/md_title_frame_margin_bottom) not found.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml","position":{"startLine":158}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml:159: AAPT: error: resource dimen/md_title_frame_margin_bottom (aka com.test.app:dimen/md_title_frame_margin_bottom) not found.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml","position":{"startLine":203}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_colorchooser_custom.xml:204: AAPT: error: resource dimen/md_title_frame_margin_bottom (aka com.test.app:dimen/md_title_frame_margin_bottom) not found.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_inputpref.xml","position":{"startLine":1}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_inputpref.xml:2: AAPT: error: resource dimen/md_content_padding_bottom (aka com.test.app:dimen/md_content_padding_bottom) not found.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_inputpref.xml","position":{"startLine":1}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_inputpref.xml:2: AAPT: error: resource dimen/md_content_padding_top (aka com.test.app:dimen/md_content_padding_top) not found.\n    ","tool":"AAPT"}
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_inputpref.xml","position":{"startLine":12}}],"original":"C:\\Users\\account\\.gradle\\caches\\transforms-2\\files-2.1\\d877ae290287c8ae9b2122602fbea4e2\\jetified-commons-0.9.4.5\\res\\layout\\md_stub_inputpref.xml:13: AAPT: error: resource dimen/md_content_padding_bottom (aka com.test.app:dimen/md_content_padding_bottom) not found.\n    ","tool":"AAPT"}

Execution failed for task ':app:processDevDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\heiyulong\.gradle\caches\transforms-2\files-2.1\d877ae290287c8ae9b2122602fbea4e2\jetified-commons-0.9.4.5\res\layout\md_stub_colorchooser_custom.xml:2: AAPT: error: resource dimen/md_title_frame_margin_bottom (aka com.test.app:dimen/md_title_frame_margin_bottom) not found.

错误分析:

根据错误日志分析,得出关键信息jetified-commons-0.9.4.5该库缺少资源文件;

在Android studio左侧的Project栏的External Libraries中查看,可以看到有两个版本的库依赖,猜测是由于引入了和当前编译版本号不同的支持库所产生的问题

app依赖库

查看新引入的sdk的依赖库信息,确实有引入3.3.0版本库

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])

    // Material Dialogs
    implementation  'com.afollestad.material-dialogs:core:3.3.0'
    implementation  'com.afollestad.material-dialogs:input:3.3.0'
    implementation  'com.afollestad.material-dialogs:lifecycle:3.3.0'
}

在自己工程中去查找是否引入的com.afollestad.material-dialogs:commons:0.9.4.5库,

但是没有搜索到引入该库的地方,猜测是引入的其它第三方SDK依赖了该库,但是如何快速定位查询库的依赖关系呢?

查看库的依赖:

打开Android Studio中Terminal面板,输入如下命令:

gradlew clean app:dependencies

app是具体的module。

查找库依赖

回车执行后如下:

  • x.x.x (*) 该依赖已经有了,将不再重复依赖。
  • x.x.x -> x.x.x 该依赖的版本被箭头所指的版本代替。
  • x.x.x -> x.x.x(*) 该依赖的版本被箭头所指的版本代替,并且该依赖已经有了,不再重复依赖。
|    +--- project :baijiayun
|    |    +--- com.baijiayun.live:liveplayer-sdk-ui:2.4.3
|    |    |    +--- com.baijiayun.live:liveplayer-sdk-core:2.5.2
|    |    |    |    +--- com.baijia.player:bjyrtcengine-liveplayer:1.1.18
|    |    |    |    |    +--- com.google.code.gson:gson:2.8.5 -> 2.8.6
|    |    |    |    |    +--- log4j:log4j:1.2.17
|    |    |    |    |    +--- de.mindpipe.android:android-logging-log4j:1.0.3
|    |    |    |    |    +--- com.squareup.okhttp3:okhttp:3.11.0 -> 4.4.0 (*)
|    |    |    |    |    +--- com.baijia.player:bj-video-player:2.0.4
|    |    |    |    |    +--- com.baijia.player:baijiayun-webrtc:1.0.28685.m77.14
|    |    |    |    |    +--- com.baijia.player:bjyrtcsdk-liveplayer:1.1.17
|    |    |    |    |    |    +--- com.google.code.findbugs:jsr305:2.0.1 -> 3.0.2
|    |    |    |    |    |    +--- com.baijia.player:baijiayun-webrtc:1.0.28685.m77.14
|    |    |    |    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    |    |    |    +--- io.agora.rtc:full-sdk:2.9.0.106
|    |    |    |    |    +--- com.baijia.player:bjyrtcengine-depends:2.9.0.106
|    |    |    |    |    +--- com.baijia.player:LiteAVSDK_TRTC:7.2.8951
|    |    |    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    |    |    +--- com.baijia.player:bjslavsdk-liveplayer:1.1.265
|    |    |    |    |    \--- com.baijia.player:bj-video-player:2.0.3 -> 2.0.4
|    |    |    |    +--- com.tencent.tbs.tbssdk:sdk:43697
|    |    |    |    +--- com.baijia.common:common-networkv2:2.0.1
|    |    |    |    |    +--- com.squareup.okhttp3:okhttp:3.8.1 -> 4.4.0 (*)
|    |    |    |    |    \--- com.baijia.common:common-cache:1.1.5
|    |    |    |    |         \--- com.google.code.gson:gson:2.6.2 -> 2.8.6
|    |    |    |    +--- com.baijia.common:common-networkv2-ws:2.0.1
|    |    |    |    |    \--- com.baijia.common:common-networkv2:2.0.1 (*)
|    |    |    |    +--- com.baijia.common.glide:glide:4.8.1
|    |    |    |    |    +--- com.baijia.common.glide:gifdecoder:4.8.1
|    |    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |    +--- com.baijia.common.glide:disklrucache:4.8.1
|    |    |    |    |    +--- com.baijia.common.glide:annotations:4.8.1
|    |    |    |    |    \--- androidx.fragment:fragment:1.0.0 -> 1.2.5 (*)
|    |    |    |    +--- io.reactivex.rxjava2:rxjava:2.2.6
|    |    |    |    |    \--- org.reactivestreams:reactive-streams:1.0.2
|    |    |    |    +--- io.reactivex.rxjava2:rxandroid:2.1.1
|    |    |    |    |    \--- io.reactivex.rxjava2:rxjava:2.2.6 (*)
|    |    |    |    +--- com.github.pwittchen:reactivenetwork-rx2:2.1.0
|    |    |    |    |    +--- io.reactivex.rxjava2:rxjava:2.2.0 -> 2.2.6 (*)
|    |    |    |    |    +--- io.reactivex.rxjava2:rxandroid:2.0.2 -> 2.1.1 (*)
|    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    +--- com.orhanobut:logger:2.2.0
|    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    |    |    \--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
|    |    |    +--- com.android.databinding:baseLibrary:3.4.2 -> androidx.databinding:databinding-common:3.6.3
|    |    |    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.50 -> 1.3.72 (*)
|    |    |    +--- com.baijia.common:common-networkv2:2.0.1 (*)
|    |    |    +--- com.baijia.common:common-networkv2-ws:2.0.1 (*)
|    |    |    +--- de.hdodenhof:circleimageview:2.2.0
|    |    |    +--- com.baijia.common:common-image-crop:1.3.2
|    |    |    |    +--- com.baijia.common:common-utils:1.0.0
|    |    |    |    +--- com.baijia.common:common-tools:1.0.0
|    |    |    |    |    +--- com.baijia.common:common-utils:1.0.0
|    |    |    |    |    \--- androidx.legacy:legacy-support-v4:1.0.0
|    |    |    |    |         +--- androidx.core:core:1.0.0 -> 1.3.2 (*)
|    |    |    |    |         +--- androidx.media:media:1.0.0
|    |    |    |    |         |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |         |    +--- androidx.core:core:1.0.0 -> 1.3.2 (*)
|    |    |    |    |         |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0 -> 1.1.0 (*)
|    |    |    |    |         +--- androidx.legacy:legacy-support-core-utils:1.0.0
|    |    |    |    |         |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |         |    +--- androidx.core:core:1.0.0 -> 1.3.2 (*)
|    |    |    |    |         |    +--- androidx.documentfile:documentfile:1.0.0
|    |    |    |    |         |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |         |    +--- androidx.loader:loader:1.0.0 (*)
|    |    |    |    |         |    +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0 (*)
|    |    |    |    |         |    \--- androidx.print:print:1.0.0
|    |    |    |    |         |         \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |         +--- androidx.legacy:legacy-support-core-ui:1.0.0
|    |    |    |    |         |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |         |    +--- androidx.core:core:1.0.0 -> 1.3.2 (*)
|    |    |    |    |         |    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    |    |    |    |         |    +--- androidx.customview:customview:1.0.0 (*)
|    |    |    |    |         |    +--- androidx.viewpager:viewpager:1.0.0 (*)
|    |    |    |    |         |    +--- androidx.coordinatorlayout:coordinatorlayout:1.0.0 -> 1.1.0 (*)
|    |    |    |    |         |    +--- androidx.drawerlayout:drawerlayout:1.0.0 (*)
|    |    |    |    |         |    +--- androidx.slidingpanelayout:slidingpanelayout:1.0.0
|    |    |    |    |         |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |         |    |    +--- androidx.core:core:1.0.0 -> 1.3.2 (*)
|    |    |    |    |         |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    |    |    |         |    +--- androidx.interpolator:interpolator:1.0.0 (*)
|    |    |    |    |         |    +--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
|    |    |    |    |         |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |         |    |    +--- androidx.core:core:1.0.0 -> 1.3.2 (*)
|    |    |    |    |         |    |    \--- androidx.interpolator:interpolator:1.0.0 (*)
|    |    |    |    |         |    +--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
|    |    |    |    |         |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    |         |    |    \--- androidx.core:core:1.0.0 -> 1.3.2 (*)
|    |    |    |    |         |    \--- androidx.cursoradapter:cursoradapter:1.0.0 (*)
|    |    |    |    |         \--- androidx.fragment:fragment:1.0.0 -> 1.2.5 (*)
|    |    |    |    +--- com.baijia.common.glide:glide:4.8.1 (*)
|    |    |    |    +--- androidx.recyclerview:recyclerview:1.0.0 -> 1.1.0 (*)
|    |    |    |    \--- androidx.legacy:legacy-support-v4:1.0.0 (*)
|    |    |    +--- io.reactivex.rxjava2:rxjava:2.2.6 (*)
|    |    |    +--- io.reactivex.rxjava2:rxandroid:2.1.1 (*)
|    |    |    +--- com.afollestad.material-dialogs:commons:0.9.4.5
|    |    |    |    +--- com.afollestad.material-dialogs:core:0.9.4.5 -> 3.3.0
|    |    |    |    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    |    |    |    |    +--- androidx.recyclerview:recyclerview:1.1.0 (*)
|    |    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
|    |    |    |    |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.61 -> 1.4.10 (*)
|    |    |    |    |         \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61 -> 1.3.72
|    |    |    |    |              \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.72 -> 1.4.10 (*)
|    |    |    |    +--- androidx.legacy:legacy-support-v13:1.0.0
|    |    |    |    |    \--- androidx.legacy:legacy-support-v4:1.0.0 (*)
|    |    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    |    +--- com.google.code.gson:gson:2.8.2 -> 2.8.6

通过鼠标右键点击find,查找0.9.4.5的库的依赖关系,查找层级的上一级,定位到所依赖的库版本冲突的地方。

然后将低版本库升级到最新版本即可解决。

< END >

【Android进化之路】

【Android进化之路】

微信扫描二维码,关注我的公众号。