App依賴查看及升級

依賴項類型

apply plugin: 'com.android.application'
android { ... }
dependencies { 
    // Dependency on a local library module      本地庫模塊依賴項
    implementation project(":mylibrary")
   
    // Dependency on local binaries              本地二進制文件依賴項
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    // Dependency on a remote binary             遠程二進制文件依賴項
    implementation 'com.example.android:app-magic:12.3'
}

依賴升級

項目通常會統一版本,採用第一行的方式添加依賴,就不會向第二行這樣提示你升級(第二行你代碼你只需要放上去Alt+Enter就可以選擇更新版本號了)

這兩種依賴你都可以在‘Project Structure’中 修改版本,如下波浪線提示很明顯:

依賴查看

先推薦一篇好文章Android 查看項目依賴樹的四種方式

1.項目根目錄 - 查看重複依賴

全局搜索'1.0.1',然後修改版本即可

2.命令行 - 查看依賴關係

 ./gradlew :app:dependencies 

也可以啓動Gradle task,層級如下,記得是app的,不要選(root),root的‘help/dependencies’,可以用來排查依賴問題:

運行結果

先說說依賴後面有(),代表什麼意思(命令行中也有提示的)

 +--- com.android.support:drawerlayout:28.0.0
|    |    |         |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |         |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |         |    |    \--- com.android.support:customview:28.0.0 (*)
(c) - dependency constraint
(*) - dependencies omitted (listed previously)
(n) - Not resolved (configuration is not meant to be resolved)

(c) -依賴限制
(*) -省略依賴項(先前列出)
(n) -未解析(配置不意味着要解析)

->  -On the left side of -> is the requested version, on the right the version that will be picked. Here similar question can be found.(左側是請求的版本,右側是將被選中的版本)
(*) It means that elsewhere in the report, the dependency was already presented with the whole subdependencies, hence here it's root only. (這意味着在報告的其他地方,依賴關係已經呈現出整個子依賴關係,因此它只是根源)

官方雖給瞭解釋,但是簡短我沒能理解 於是google了一下纔得到兩行英文解釋  連接

項目中的module有多渠道,及構建方式,輸出結果會把所有三個參數組合起來,分別列出來,module中的module也會列出來(通常依賴內容受 隨渠道,構建方式影響不大,我說了通常)。如果項目中有傳遞依賴,我們只需要找到App的信息就好,所有的依賴就會列出來了,大致如下(渠道:bd,構建方式:Debug,記得要看運行時依賴(Runtime classpath of compilation 'bdDebug')):

bdDebugRuntimeClasspath - Runtime classpath of compilation 'bdDebug' (target  (androidJvm)).
+--- project :bus-common
|    +--- project :libcommon
|    |    +--- io.realm:realm-android-library:5.8.0
|    |    |    +--- com.google.code.findbugs:jsr305:3.0.2
|    |    |    +--- com.getkeepsafe.relinker:relinker:1.3.0
|    |    |    \--- io.realm:realm-annotations:5.8.0
|    |    +--- io.realm:realm-android-kotlin-extensions:5.8.0
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.50 -> 1.3.41
|    |    |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.41
|    |    |              +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.41
|    |    |              \--- org.jetbrains:annotations:13.0
|    |    +--- io.realm:realm-annotations:5.8.0
|    |    +--- project :oss-android-sdk
|    |    |    +--- com.squareup.okhttp3:okhttp:3.12.0
|    |    |    |    \--- com.squareup.okio:okio:1.15.0
|    |    |    \--- org.jacoco:org.jacoco.agent:0.7.9
|    |    +--- project :mp3recorder
|    |    +--- com.android.support:support-v4:28.0.0
|    |    |    +--- com.android.support:support-compat:28.0.0
|    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    +--- com.android.support:collections:28.0.0
|    |    |    |    |    \--- com.android.support:support-annotations:28.0.0
|    |    |    |    +--- android.arch.lifecycle:runtime:1.1.1
|    |    |    |    |    +--- android.arch.lifecycle:common:1.1.1
|    |    |    |    |    |    \--- com.android.support:support-annotations:26.1.0 -> 28.0.0
|    |    |    |    |    +--- android.arch.core:common:1.1.1
|    |    |    |    |    |    \--- com.android.support:support-annotations:26.1.0 -> 28.0.0
|    |    |    |    |    \--- com.android.support:support-annotations:26.1.0 -> 28.0.0
|    |    |    |    \--- com.android.support:versionedparcelable:28.0.0
|    |    |    |         +--- com.android.support:support-annotations:28.0.0
|    |    |    |         \--- com.android.support:collections:28.0.0 (*)
|    |    |    +--- com.android.support:support-media-compat:28.0.0
|    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    \--- com.android.support:versionedparcelable:28.0.0 (*)
|    |    |    +--- com.android.support:support-core-utils:28.0.0
|    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    +--- com.android.support:documentfile:28.0.0
|    |    |    |    |    \--- com.android.support:support-annotations:28.0.0
|    |    |    |    +--- com.android.support:loader:28.0.0
|    |    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    |    +--- android.arch.lifecycle:livedata:1.1.1
|    |    |    |    |    |    +--- android.arch.core:runtime:1.1.1
|    |    |    |    |    |    |    +--- com.android.support:support-annotations:26.1.0 -> 28.0.0
|    |    |    |    |    |    |    \--- android.arch.core:common:1.1.1 (*)
|    |    |    |    |    |    +--- android.arch.lifecycle:livedata-core:1.1.1
|    |    |    |    |    |    |    +--- android.arch.lifecycle:common:1.1.1 (*)
|    |    |    |    |    |    |    +--- android.arch.core:common:1.1.1 (*)
|    |    |    |    |    |    |    \--- android.arch.core:runtime:1.1.1 (*)
|    |    |    |    |    |    \--- android.arch.core:common:1.1.1 (*)
|    |    |    |    |    \--- android.arch.lifecycle:viewmodel:1.1.1
|    |    |    |    |         \--- com.android.support:support-annotations:26.1.0 -> 28.0.0
|    |    |    |    +--- com.android.support:localbroadcastmanager:28.0.0
|    |    |    |    |    \--- com.android.support:support-annotations:28.0.0
|    |    |    |    \--- com.android.support:print:28.0.0
|    |    |    |         \--- com.android.support:support-annotations:28.0.0
|    |    |    +--- com.android.support:support-core-ui:28.0.0
|    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    +--- com.android.support:support-core-utils:28.0.0 (*)
|    |    |    |    +--- com.android.support:customview:28.0.0
|    |    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    |    \--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    +--- com.android.support:viewpager:28.0.0
|    |    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    |    \--- com.android.support:customview:28.0.0 (*)
|    |    |    |    +--- com.android.support:coordinatorlayout:28.0.0
|    |    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    |    \--- com.android.support:customview:28.0.0 (*)
|    |    |    |    +--- com.android.support:drawerlayout:28.0.0
|    |    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    |    \--- com.android.support:customview:28.0.0 (*)
|    |    |    |    +--- com.android.support:slidingpanelayout:28.0.0
|    |    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    |    \--- com.android.support:customview:28.0.0 (*)
|    |    |    |    +--- com.android.support:interpolator:28.0.0
|    |    |    |    |    \--- com.android.support:support-annotations:28.0.0
|    |    |    |    +--- com.android.support:swiperefreshlayout:28.0.0
|    |    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    |    \--- com.android.support:interpolator:28.0.0 (*)
|    |    |    |    +--- com.android.support:asynclayoutinflater:28.0.0
|    |    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    |    \--- com.android.support:support-compat:28.0.0 (*)
|    |    |    |    \--- com.android.support:cursoradapter:28.0.0
|    |    |    |         \--- com.android.support:support-annotations:28.0.0
|    |    |    \--- com.android.support:support-fragment:28.0.0
|    |    |         +--- com.android.support:support-compat:28.0.0 (*)
|    |    |         +--- com.android.support:support-core-ui:28.0.0 (*)
|    |    |         +--- com.android.support:support-core-utils:28.0.0 (*)
|    |    |         +--- com.android.support:support-annotations:28.0.0
|    |    |         +--- com.android.support:loader:28.0.0 (*)
|    |    |         \--- android.arch.lifecycle:viewmodel:1.1.1 (*)
|    |    +--- com.android.support:appcompat-v7:28.0.0
|    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    +--- com.android.support:collections:28.0.0 (*)
|    |    |    +--- com.android.support:cursoradapter:28.0.0 (*)
|    |    |    +--- com.android.support:support-core-utils:28.0.0 (*)
|    |    |    +--- com.android.support:support-fragment:28.0.0 (*)
|    |    |    +--- com.android.support:support-vector-drawable:28.0.0
|    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    \--- com.android.support:support-compat:28.0.0 (*)
|    |    |    \--- com.android.support:animated-vector-drawable:28.0.0
|    |    |         +--- com.android.support:support-vector-drawable:28.0.0 (*)
|    |    |         \--- com.android.support:support-core-ui:28.0.0 (*)
|    |    +--- com.android.support:design:28.0.0
|    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    +--- com.android.support:support-compat:28.0.0 (*)
|    |    |    +--- com.android.support:support-core-ui:28.0.0 (*)
|    |    |    +--- com.android.support:support-core-utils:28.0.0 (*)
|    |    |    +--- com.android.support:support-fragment:28.0.0 (*)
|    |    |    +--- com.android.support:transition:28.0.0
|    |    |    |    +--- com.android.support:support-annotations:28.0.0
|    |    |    |    \--- com.android.support:support-compat:28.0.0 (*)
|    |    |    +--- com.android.support:appcompat-v7:28.0.0 (*)
|    |    |    +--- com.android.support:cardview-v7:28.0.0
|    |    |    |    \--- com.android.support:support-annotations:28.0.0
|    |    |    \--- com.android.support:recyclerview-v7:28.0.0
|    |    |         +--- com.android.support:support-annotations:28.0.0
|    |    |         +--- com.android.support:support-compat:28.0.0 (*)
|    |    |         \--- com.android.support:support-core-ui:28.0.0 (*)
|    |    +--- io.reactivex.rxjava2:rxjava:2.2.9
|    |    |    \--- org.reactivestreams:reactive-streams:1.0.2
|    |    +--- io.reactivex.rxjava2:rxandroid:2.1.1
|    |    |    \--- io.reactivex.rxjava2:rxjava:2.2.6 -> 2.2.9 (*)
|    |    +--- com.tbruyelle.rxpermissions2:rxpermissions:0.9.5
|    |    +--- me.yokeyword:fragmentation:1.3.6
|    |    |    \--- me.yokeyword:fragmentation-core:1.3.6
|    |    +--- com.orhanobut:logger:2.2.0
|    |    |    \--- com.android.support:support-annotations:27.1.0 -> 28.0.0
|    |    +--- com.google.code.gson:gson:2.8.5
|    |    +--- com.squareup.retrofit2:retrofit:2.6.0
|    |    |    \--- com.squareup.okhttp3:okhttp:3.12.0 (*)
|    |    +--- com.squareup.retrofit2:converter-gson:2.6.0
|    |    |    +--- com.squareup.retrofit2:retrofit:2.6.0 (*)
|    |    |    \--- com.google.code.gson:gson:2.8.5
|    |    +--- com.squareup.retrofit2:adapter-rxjava2:2.6.0
|    |    |    +--- com.squareup.retrofit2:retrofit:2.6.0 (*)
|    |    |    \--- io.reactivex.rxjava2:rxjava:2.0.0 -> 2.2.9 (*)
|    |    +--- com.squareup.okhttp3:okhttp:3.12.0 (*)
|    |    +--- com.squareup.okhttp3:logging-interceptor:3.12.0
|    |    |    \--- com.squareup.okhttp3:okhttp:3.12.0 (*)
|    |    +--- com.github.bumptech.glide:glide:3.7.0
|    |    +--- com.github.bumptech.glide:okhttp3-integration:1.4.0
|    |    +--- org.jsoup:jsoup:1.10.1
|    |    +--- com.arialyy.aria:aria-core:3.6.4
|    |    |    +--- com.arialyy.aria:aria-annotations:3.6.4
|    |    |    \--- com.arialyy.aria:aria-ftp-plug:1.0.4
|    |    +--- com.jakewharton:butterknife:9.0.0
|    |    |    \--- com.jakewharton:butterknife-runtime:9.0.0
|    |    |         +--- com.jakewharton:butterknife-annotations:9.0.0
|    |    |         |    \--- com.android.support:support-annotations:28.0.0
|    |    |         \--- com.android.support:support-compat:28.0.0 (*)
|    |    +--- com.belerweb:pinyin4j:2.5.1
|    |    +--- com.android.support:multidex:1.0.2
|    |    +--- com.tencent.bugly:crashreport:2.8.6.0
|    |    +--- org.greenrobot:eventbus:3.1.1
|    |    +--- cn.bingoogolapple:bga-qrcode-zbar:1.3.4
|    |    |    \--- cn.bingoogolapple:bga-qrcode-core:1.3.4
|    |    +--- top.zibin:Luban:1.1.3
|    |    +--- com.danikula:videocache:2.7.0
|    |    |    \--- org.slf4j:slf4j-android:1.7.21
|    |    |         \--- org.slf4j:slf4j-api:1.7.21
|    |    +--- com.android.support.constraint:constraint-layout:1.1.3
|    |    |    \--- com.android.support.constraint:constraint-layout-solver:1.1.3
|    |    +--- com.jcodecraeer:xrecyclerview:1.5.9
|    |    |    +--- com.android.support:appcompat-v7:23.4.0 -> 28.0.0 (*)
|    |    |    +--- com.android.support:recyclerview-v7:23.4.0 -> 28.0.0 (*)
|    |    |    \--- com.android.support:design:23.4.0 -> 28.0.0 (*)
|    |    +--- com.android.support:recyclerview-v7:28.0.0 (*)
|    |    +--- es.voghdev.pdfviewpager:library:1.0.5
|    |    |    +--- com.android.support:appcompat-v7:25.4.0 -> 28.0.0 (*)
|    |    |    \--- com.commit451:PhotoView:1.2.4
|    |    |         \--- com.android.support:support-v4:23.0.1 -> 28.0.0 (*)
|    |    +--- project :jpush
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.41 (*)
|    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.41
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.41 (*)
|    +--- com.android.support.constraint:constraint-layout:1.1.3 (*)
|    +--- com.wuxiaolong.pullloadmorerecyclerview:library:1.1.2
|    |    +--- com.android.support:appcompat-v7:25.0.0 -> 28.0.0 (*)
|    |    \--- com.android.support:recyclerview-v7:25.0.0 -> 28.0.0 (*)
|    +--- com.android.support:support-v4:28.0.0 (*)
|    +--- io.reactivex.rxjava2:rxjava:2.2.9 (*)
|    +--- io.reactivex.rxjava2:rxandroid:2.1.1 (*)
|    +--- com.tbruyelle.rxpermissions2:rxpermissions:0.9.5
|    +--- me.yokeyword:fragmentation:1.3.6 (*)
|    +--- com.orhanobut:logger:2.2.0 (*)
|    +--- com.google.code.gson:gson:2.8.5
|    +--- com.squareup.okhttp3:okhttp:3.12.0 (*)
|    +--- com.squareup.retrofit2:retrofit:2.6.0 (*)
|    +--- com.github.bumptech.glide:glide:3.7.0
|    +--- com.belerweb:pinyin4j:2.5.1
|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.41 (*)
|    +--- cn.aigestudio.wheelpicker:WheelPicker:1.1.2
|    +--- com.github.1002326270xc:LayoutManager-FlowLayout:v1.7
|    |    +--- com.android.support:appcompat-v7:25.3.1 -> 28.0.0 (*)
|    |    \--- com.android.support:recyclerview-v7:25.3.1 -> 28.0.0 (*)
|    \--- com.contrarywind:Android-PickerView:4.1.8
|         +--- com.contrarywind:wheelview:4.0.9
|         |    \--- com.android.support:support-annotations:28.0.0
|         \--- com.android.support:support-annotations:28.0.0
+--- com.android.support:multidex:1.0.2
+--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.41 (*)
+--- io.socket:socket.io-client:1.0.0
|    \--- io.socket:engine.io-client:1.0.0
|         \--- com.squareup.okhttp3:okhttp:3.8.1 -> 3.12.0 (*)
+--- io.reactivex.rxjava2:rxjava:2.2.9 (*)
+--- io.reactivex.rxjava2:rxandroid:2.1.1 (*)
+--- com.tbruyelle.rxpermissions2:rxpermissions:0.9.5
+--- me.yokeyword:fragmentation:1.3.6 (*)
+--- com.orhanobut:logger:2.2.0 (*)
+--- com.google.code.gson:gson:2.8.5
+--- com.squareup.okhttp3:okhttp:3.12.0 (*)
+--- com.squareup.retrofit2:retrofit:2.6.0 (*)
+--- com.github.bumptech.glide:glide:3.7.0
+--- com.jakewharton:butterknife:9.0.0 (*)
+--- com.belerweb:pinyin4j:2.5.1
+--- org.greenrobot:eventbus:3.1.1
+--- com.android.support.constraint:constraint-layout:1.1.3 (*)
+--- com.zhihu.android:matisse:0.4.3
|    +--- com.android.support:support-v4:25.3.1 -> 28.0.0 (*)
|    +--- com.android.support:appcompat-v7:25.3.1 -> 28.0.0 (*)
|    +--- com.android.support:support-annotations:25.3.1 -> 28.0.0
|    +--- com.android.support:recyclerview-v7:25.3.1 -> 28.0.0 (*)
|    \--- it.sephiroth.android.library.imagezoom:library:1.0.4
|         \--- it.sephiroth.android.library.easing:library:1.0.2
\--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.41 (*)

接下來開始分析問題:

比如這裏依賴了知乎的開源庫,它自己的版本是0.4.3,而裏面依賴的庫都不是最新的,說明了一個問題:很有可能‘0.4.3’已經不是最新的版本了。查一下,果然最新的已經是'0.5.2-beta5'。

|    +--- com.android.support:support-v4:25.3.1 -> 28.0.0 (*)

+--- com.zhihu.android:matisse:0.4.3
|    +--- com.android.support:support-v4:25.3.1 -> 28.0.0 (*)
|    +--- com.android.support:appcompat-v7:25.3.1 -> 28.0.0 (*)
|    +--- com.android.support:support-annotations:25.3.1 -> 28.0.0
|    +--- com.android.support:recyclerview-v7:25.3.1 -> 28.0.0 (*)
|    \--- it.sephiroth.android.library.imagezoom:library:1.0.4
|         \--- it.sephiroth.android.library.easing:library:1.0.2

現在的依賴關係如下:

發現這時的依賴變成了androidx,如果你項目使用了androidx 倒是不存在問題,如果沒有依賴androidx,你要麼去支持androidx(很麻煩的),要麼退到沒有androidx 的版本,這裏是'0.5.2-beta4'。

com.zhihu.android:matisse:0.5.2-beta5
|    +--- androidx.appcompat:appcompat:1.0.2
|    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    +--- androidx.core:core:1.0.1
|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    +--- androidx.collection:collection:1.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    +--- androidx.lifecycle:lifecycle-runtime:2.0.0
|    |    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0
|    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    +--- androidx.arch.core:core-common:2.0.0
|    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0
|    |    |         +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |         \--- androidx.collection:collection:1.0.0 (*)
|    |    +--- androidx.collection:collection:1.0.0 (*)
|    |    +--- androidx.cursoradapter:cursoradapter:1.0.0
|    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    +--- androidx.documentfile:documentfile:1.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    +--- androidx.loader:loader:1.0.0
|    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    +--- androidx.lifecycle:lifecycle-livedata:2.0.0
|    |    |    |    |    +--- androidx.arch.core:core-runtime:2.0.0
|    |    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    |    |    \--- androidx.arch.core:core-common:2.0.0 (*)
|    |    |    |    |    +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
|    |    |    |    |    |    +--- androidx.lifecycle:lifecycle-common:2.0.0 (*)
|    |    |    |    |    |    +--- androidx.arch.core:core-common:2.0.0 (*)
|    |    |    |    |    |    \--- androidx.arch.core:core-runtime:2.0.0 (*)
|    |    |    |    |    \--- androidx.arch.core:core-common:2.0.0 (*)
|    |    |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0
|    |    |    |         \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
|    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    \--- androidx.print:print:1.0.0
|    |    |         \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    +--- androidx.fragment:fragment:1.0.0
|    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    +--- androidx.legacy:legacy-support-core-ui:1.0.0
|    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    |    |    |    +--- androidx.customview:customview:1.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    |    \--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    +--- androidx.viewpager:viewpager:1.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    |    |    +--- androidx.coordinatorlayout:coordinatorlayout:1.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    |    |    +--- androidx.drawerlayout:drawerlayout:1.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    |    |    +--- androidx.slidingpanelayout:slidingpanelayout:1.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    |    \--- androidx.customview:customview:1.0.0 (*)
|    |    |    |    +--- androidx.interpolator:interpolator:1.0.0
|    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    +--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    |    \--- androidx.interpolator:interpolator:1.0.0 (*)
|    |    |    |    +--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    |    |    \--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    \--- androidx.cursoradapter:cursoradapter:1.0.0 (*)
|    |    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    +--- androidx.loader:loader:1.0.0 (*)
|    |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 (*)
|    |    +--- androidx.vectordrawable:vectordrawable:1.0.1
|    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    |    \--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    \--- androidx.vectordrawable:vectordrawable-animated:1.0.0
|    |         +--- androidx.vectordrawable:vectordrawable:1.0.0 -> 1.0.1 (*)
|    |         \--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
|    +--- androidx.annotation:annotation:1.0.1
|    +--- androidx.recyclerview:recyclerview:1.0.0
|    |    +--- androidx.annotation:annotation:1.0.0 -> 1.0.1
|    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    \--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
|    \--- it.sephiroth.android.library.imagezoom:library:1.0.4
|         \--- it.sephiroth.android.library.easing:library:1.0.2

修改後的依賴關係如下:

+--- com.zhihu.android:matisse:0.5.2-beta4
|    +--- com.android.support:support-v4:27.1.1 -> 28.0.0 (*)
|    +--- com.android.support:appcompat-v7:27.1.1 -> 28.0.0 (*)
|    +--- com.android.support:support-annotations:27.1.1 -> 28.0.0
|    +--- com.android.support:recyclerview-v7:27.1.1 -> 28.0.0 (*)
|    \--- it.sephiroth.android.library.imagezoom:library:1.0.4
|         \--- it.sephiroth.android.library.easing:library:1.0.2

還是有依舊不是最新的,但是沒有影響,是被忽略了的(*)。

升級的時的問題

不知大家手上有沒有老項目,加點依賴總是感覺不兼容,加不進去?

這裏還有一個級別高的依賴那就是項目依賴,我這裏的gradle版本最開始是‘2.3.0‘加什麼東西都可能不兼容,在我升級realm數據庫版本的時候就出現了問題,我直接向realm升級到’5.14.0‘,發現它要求gradle 版本升級,於是我升級了,但是最新正式版本’3.5.0‘,編譯ADIL會出問題(>.< ~~~~有大佬知道的嗎,給個留言),我就退而求其次,選擇’3.4.2‘。

順便提一下 - 包衝突問題

如果之前項目中是將依賴源碼下載,用module的方式依賴,而後面在某個地方再次使用配置的方式依賴進來(或者是依賴樹中包含),在打包apk時會提示包衝突,所以要麼刪除這個module,要麼忽略樹依賴中的依賴。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章