files found with path ‘META-INF/versions/9/previous-compilation-data.bin‘

最近在使用本地maven仓库依赖的时候遇到这个问题:

files found with path 'META-INF/versions/9/previous-compilation-data.bin'

记录一下解决方案:

问题步骤:

1.依赖本地maven仓库

mavenLocal()
  maven {
      url file('sdk/android/maven')
      allowInsecureProtocol = true
  }

2.app-build.gradle导入依赖

implementation "saild.test.cat:httpclient:5.0.0"
implementation "saild.test.cat:httpclient-okhttp:3.0.0"

然后rebuild后,报错:

files found with path 'META-INF/versions/9/previous-compilation-data.bin'

解决方案:

再app得build.gradle里面添加:

adnroid{
	 ...
	 packagingOptions {
        exclude 'META-INF/versions/9/previous-compilation-data.bin'
    }
}

根据报错信息,忽略相对应的冲突文件

你可能感兴趣的:(andoird,gradle)