android - 程序类型已经存在 : org. apache.http.auth.AuthSchemeFactory

标签 android gradle

我用了Picasso作为我的应用程序项目和聊天库的依赖项

这是我在编译代码时遇到的错误:

Program type already present: org.apache.http.auth.AuthSchemeFactory Message{kind=ERROR, text=Program type already present:

org.apache.http.auth.AuthSchemeFactory, sources=[Unknown source file], tool name=Optional.of(D8)}

那么如何对两个项目使用相同的依赖?

---- Root project----  
                    |
                    |
                    ---app
                    |
                    ---chat library

编辑星期六 - 2018 年 4 月 14 日

在 app>libs 文件夹中存在以下 jar 文件:

  • httpclient-4.3.6
  • httpcore-4.3.3
  • httpmime-4.3.6

最佳答案

我遇到了同样的问题。首先,您可以看到名为 D8 的新 dexer 正在运行。它似乎仍处于实验阶段,因此您可以通过以下方式在 gradle.properties 文件中暂时关闭它:

android.enableD8=false

blog announcement 中查看有关 D8 的更多详细信息

然后您可以看到更详细的错误消息,这让我想到了以下解决方案:

implementation("org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.1") {
    exclude group: 'org.apache.oltu.oauth2', module: org.apache.oltu.oauth2.common'
}

关于android - 程序类型已经存在 : org. apache.http.auth.AuthSchemeFactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49834773/

相关文章:

java - 获取菜单项以(取消)检查它

Android studio 2.1.2 gradle aapt语法错误: Unterminated quoted string

java - 错误 :Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug' . >

android - 如何发布其他人可以轻松使用的android库?

javascript - 无法在模拟器上运行React Native Project

android - Eclipse 错误中适用于 Android 的 OpenCV 库

android - 使用 json 获取查询 - Retrofit 2.0

selenium - 如何修复 docker 容器中的 "org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed"

android - Tensorflow 的应用程序相机图像模糊

android - 尝试重新缩放位图时出现 OutOfMemory 错误