余乐115 2020-04-08 10:34 采纳率: 33.3%
浏览 1968
已结题

代码迁移到Androidx,打包后运行出错,怎么解决?

build配置:

```apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion 29
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.yuyao.sl.tsyw"
minSdkVersion 23
targetSdkVersion 28
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles 'proguard-rules.txt'
    }
    /*debug {
        //控制debug模式下是否混淆了。
        minifyEnabled false
        proguardFiles 'proguard-rules.txt'
    }*/
}
packagingOptions {
    exclude 'META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}

useLibrary 'org.apache.http.legacy'
compileOptions {
    sourceCompatibility 1.8
    targetCompatibility 1.8
}

}

dependencies {
implementation project(':library')
implementation project(':androidBootstrap')
//noinspection GradleCompatible
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

implementation files('libs/android-anyc-http.jar')
implementation files('libs/guice-3.0-no_aop.jar')
implementation files('libs/javax.inject.jar')
implementation files('libs/roboguice.jar')
implementation files('libs/xUtils-2.6.14.jar')
implementation 'com.google.android.gms:play-services-appindexing:9.8.0'
implementation files('libs/sun.misc.BASE64Decoder.jar')
implementation files('libs/universal-image-loader-1.9.3-SNAPSHOT.jar')
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
// 'com.jakewharton:butterknife:7.0.1'
implementation files('libs/commons-logging-1.2.jar')
implementation files('libs/httpclient-4.5.2.jar')
implementation files('libs/httpcore-4.4.4.jar')
implementation project(path: ':actionbarsherlock')

}


错误提示:

```Entry name 'META-INF/androidx.legacy_legacy-support-core-utils.version' collided

就是打完包之后报错,clean --rebuild项目之后又能正常编译 。

  • 写回答

2条回答 默认 最新

  • zqbnqsdsmd 2020-04-08 12:07
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog