我用的android studio,添加HttpClient的依赖包之后没有报错,但是编译不通过

问题LOG:

Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1is ignoredfordebug as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1is ignoredfordebug as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1is ignoredfordebug as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency commons-logging:commons-logging:1.2is ignoredfordebug as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1is ignoredfordebug as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency commons-logging:commons-logging:1.2is ignoredfordebug as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1is ignoredforrelease as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1is ignoredforrelease as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1is ignoredforrelease as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency commons-logging:commons-logging:1.2is ignoredforrelease as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1is ignoredforrelease as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages

Warning:Dependency commons-logging:commons-logging:1.2is ignoredforrelease as it may be conflicting with the internal version provided by Android.

Incaseof problem, please repackage it with jarjar to change theclasspackages


Error:Error converting bytecode to dex:

Cause: com.android.dex.DexException: Multiple dex files define Lorg/apache/commons/codec/Decoder;

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Program Files\Java\jdk1.8\bin\java.exe'' finished with non-zero exit value 2

解决办法:

在app路径下的build.gradle中,在dependencies {compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'

} 中添加添加这个试下,我的就解决了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 174,589评论 25 709
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,642评论 2 45
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,268评论 19 139
  • 人总惯性地把某些东西攥在手里 金钱、感情、面子、荣誉…… 攥得太紧太用力 不给自己留一丝喘息 当每一只手紧握成拳头...
    莉莉安的斑马阅读 235评论 0 0
  • 待补充
    Feel君阅读 186评论 0 0