第一种
* What went wrong:
Execution failed for task ':game:preReleaseFeatureBuild'.
> Android dependency 'androidx.versionedparcelable:versionedparcelable' has different version for the compile (1.0.0) and runtime (1.1.0) classpath. You should manually set the same version via DependencyResolution
大概这种因为这种冲突的形式,可以直接在项目的build.gradle文件中添加代码块
subprojects { Project project ->
project.configurations.all {
resolutionStrategy {
force([
'androidx.versionedparcelable:versionedparcelable:1.1.0',
'androidx.viewpager:viewpager:1.0.0',
'androidx.lifecycle:lifecycle-livedata-core:2.0.0',
'androidx.legacy:legacy-support-core-utils:1.0.0',
'androidx.drawerlayout:drawerlayout:1.0.0',
] as List)
}
}
}
第二种
* What went wrong:
Execution failed for task ':game:transformResourcesWithMergeJavaResForReleaseFeature'.
> More than one file was found with OS independent path 'META-INF/proguard/okhttp3.pro'
在对应报错的module的build.gradle,android{}下添加如下代码块
packagingOptions {
exclude 'META-INF/proguard/okhttp3.pro'
}
网友评论