error: failed linking references.
前言
今天在寫demo的時候,引用了一個庫,我自己的studio是sdk25,而引用的庫的版本是sdk28,studio3.3的,版本較高,於是出現“error: failed linking references.”
解決辦法
這裡我首先將我app_module對應的
compileSdkVersion 25
修改為
compileSdkVersion 28
,然後下面引用的
implementation'com.android.support:appcompat-v7:25.3.1'
報錯,按提示修改為
implementation'com.android.support:appcompat-v7:28.0.0'
執行提示:
Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 19 declared in library [com.github.ShaoqiangPei:DemoUtil:1.0.1] C:\Users\pei\.gradle\caches\transforms-1\files-1.1\DemoUtil-1.0.1.aar\4a17a0a126acdb405884346818052524\AndroidManifest.xml as the library might be using APIs not available in 15 Suggestion: use a compatible library with a minSdk of at most 15, or increase this project's minSdk version to at least 19, or use tools:overrideLibrary="com.lib" to force usage (may lead to runtime failures)
ok,按提示將 app_module中的 minSdkVersion 15 改為 minSdkVersion 19,編譯,執行,就可以了。
看來,低的sdk配置的專案在引用高sdk配置的第三方庫,還是存在相容問題啊。