Program type already present: android.arch.lifecycle.LiveData$1
Message{kind=ERROR, text=Program type already present:
android.arch.lifecycle.LiveData$1, sources=[Unknown source file], tool
name=Optional.of(D8)}
我目前正在研究android架构,但当我尝试添加扩展库android.arch.lifecycle:extensions:1.0.0我有上面的错误,
我试图在gradle中排除生命周期公共模块
implementation('android.arch.lifecycle:extensions:1.0.0') {
exclude group: 'android.arch.lifecycle', module: 'lifecycle'
}
但仍然有上述错误,下面是gradlew的依赖关系报告
+--- com.android.support:appcompat-v7:27.1.1
| +--- com.android.support:support-annotations:27.1.1
| +--- com.android.support:support-core-utils:27.1.1
| | +--- com.android.support:support-annotations:27.1.1
| | \--- com.android.support:support-compat:27.1.1
| | +--- com.android.support:support-annotations:27.1.1
| | \--- android.arch.lifecycle:runtime:1.1.0
| | +--- android.arch.lifecycle:common:1.1.0
| | | \--- com.android.support:support-
annotations:26.1.0 -> 27.1.1
| | +--- android.arch.core:common:1.1.0
| | | \--- com.android.support:support-
annotations:26.1.0 -> 27.1.1
| | \--- com.android.support:support-
annotations:26.1.0 -> 27.1.1
| +--- com.android.support:support-fragment:27.1.1
| | +--- com.android.support:support-compat:27.1.1 (*)
| | +--- com.android.support:support-core-ui:27.1.1
| | | +--- com.android.support:support-annotations:27.1.1
| | | +--- com.android.support:support-compat:27.1.1 (*)
| | | \--- com.android.support:support-core-utils:27.1.1 (*)
| | +--- com.android.support:support-core-utils:27.1.1 (*)
| | +--- com.android.support:support-annotations:27.1.1
| | +--- android.arch.lifecycle:livedata-core:1.1.0
| | | +--- android.arch.lifecycle:common:1.1.0 (*)
| | | +--- android.arch.core:common:1.1.0 (*)
| | | \--- android.arch.core:runtime:1.1.0
| | | +--- com.android.support:support-
annotations:26.1.0 -> 27.1.1
| | | \--- android.arch.core:common:1.1.0 (*)
| | \--- android.arch.lifecycle:viewmodel:1.1.0
| +--- com.android.support:support-vector-drawable:27.1.1
| | +--- com.android.support:support-annotations:27.1.1
| | \--- com.android.support:support-compat:27.1.1 (*)
| \--- com.android.support:animated-vector-drawable:27.1.1
| +--- com.android.support:support-vector-drawable:27.1.1 (*)
| \--- com.android.support:support-core-ui:27.1.1 (*)
+--- com.android.support.constraint:constraint-layout:1.1.0
| \--- com.android.support.constraint:constraint-layout-
solver:1.1.0
+--- android.arch.lifecycle:extensions:1.0.0
| +--- android.arch.lifecycle:runtime:1.0.3 -> 1.1.0 (*)
| +--- android.arch.core:common:1.0.0 -> 1.1.0 (*)
| +--- android.arch.core:runtime:1.0.0 -> 1.1.0 (*)
| +--- com.android.support:support-fragment:26.1.0 -> 27.1.1 (*)
| \--- android.arch.lifecycle:common:1.0.3 -> 1.1.0 (*)
+--- io.reactivex.rxjava2:rxjava:2.1.12
| \--- org.reactivestreams:reactive-streams:1.0.2
\--- junit:junit:4.12
\--- org.hamcrest:hamcrest-core:1.3
我只是假设它是一个传递依赖,我只需要将LiveData的模块排除在扩展名之外。