0

在迁移到 Android X 的过程中,tt 似乎 Jetifier 工具将一些 3rd 方库转换为 RC 版本(gradle-4.6)。

 |    +--- com.facebook.android:facebook-common:4.34.0
|    |    |    +--- com.facebook.android:facebook-core:4.34.0 (*)
|    |    |    +--- com.google.zxing:core:3.3.0
|    |    |    +--- androidx.legacy:legacy-support-v4:1.0.0-rc01
|    |    |    |    +--- androidx.core:core:1.0.0-rc01 -> 1.0.1 (*)
|    |    |    |    +--- androidx.media:media:1.0.0-rc01
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0-rc01 -> 1.0.0
|    |    |    |    |    +--- androidx.core:core:1.0.0-rc01 -> 1.0.1 (*)
|    |    |    |    |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0-rc01 -> 1.0.0 (*)
|    |    |    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0-rc01 -> 1.0.0 (*)
|    |    |    |    +--- androidx.legacy:legacy-support-core-ui:1.0.0-rc01 -> 1.0.0 (*)
|    |    |    |    \--- androidx.fragment:fragment:1.0.0-rc01 -> 1.0.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.0.0-rc01 -> 1.0.2 (*)
|    |    |    +--- androidx.cardview:cardview:1.0.0-rc01 -> 1.0.0 (*)
|    |    |    \--- androidx.browser:browser:1.0.0-rc01
|    |    |         +--- androidx.core:core:1.0.0-rc01 -> 1.0.1 (*)
|    |    |         +--- androidx.annotation:annotation:1.0.0-rc01 -> 1.0.0
|    |    |         +--- androidx.interpolator:interpolator:1.0.0-rc01 -> 1.0.0 (*)
|    |    |         +--- androidx.collection:collection:1.0.0-rc01 -> 1.0.0 (*)
|    |    |         \--- androidx.legacy:legacy-support-core-ui:1.0.0-rc01 -> 1.0.0 (*)

有没有我可以强制只采用稳定(固定)版本的解决方案?

4

1 回答 1

7

嗯,挖了jetifier源码,好像jetifier自带的gradle-4.6版本是alpha10:

/gradle/m2repository/com/android/tools/build/jetifier/jetifier-processor/1.0.0-alpha10/jetifier-processor-1.0.0-alpha10.jar /gradle/m2repository/com/android/tools/build/ jetifier/jetifier-core/1.0.0-alpha10/jetifier-core-1.0.0-alpha10.jar

这个包中的本地映射文件 jetifier 将一些支持库转换为 RC 版本。

添加更新的 jetifier 依赖项解决了这个问题(top build.gradle):

 classpath 'com.android.tools.build.jetifier:jetifier-core:1.0.0-beta02'
 classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'

以下是 facebook 依赖树的结果:

+--- com.facebook.android:facebook-common:4.34.0
|    |    |    +--- com.facebook.android:facebook-core:4.34.0 (*)
|    |    |    +--- com.google.zxing:core:3.3.0
|    |    |    +--- androidx.legacy:legacy-support-v4:1.0.0
|    |    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    +--- androidx.media:media:1.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0
|    |    |    |    |    +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |    |    |    \--- androidx.versionedparcelable:versionedparcelable:1.0.0 (*)
|    |    |    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    |    |    |    +--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
|    |    |    |    \--- androidx.fragment:fragment:1.0.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.0.2 (*)
|    |    |    +--- androidx.cardview:cardview:1.0.0 (*)
|    |    |    \--- androidx.browser:browser:1.0.0
|    |    |         +--- androidx.core:core:1.0.0 -> 1.0.1 (*)
|    |    |         +--- androidx.annotation:annotation:1.0.0
|    |    |         +--- androidx.interpolator:interpolator:1.0.0 (*)
|    |    |         +--- androidx.collection:collection:1.0.0 (*)
|    |    |         \--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
于 2018-11-22T15:33:07.397 回答