1

我正在尝试将以下依赖项添加到我的 android studio 项目中,但似乎出了点问题,我不明白!

compile 'ca.uhn.hapi.fhir:hapi-fhir-base:1.4'
compile 'ca.uhn.hapi.fhir:hapi-fhir-structures-hl7org-dstu2:1.4'
compile 'ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu2:1.4'
compile 'org.slf4j:slf4j-simple:1.6.1'

这是错误:

    Information:Gradle tasks [:app:assembleDebug]
Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1 is ignored for lintOptions as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.5.1 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preLintOptionsBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportPercent2311Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComJjoe64Graphview401Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJavaWithJavac
Note: /PolimiMac/PersonalHealthRecord/app/src/main/java/polimi/aap/yas/personalhealthrecord/Chronograms.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:transformClassesWithJarMergingForDebug FAILED
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: javax/json/Json.class
Information:BUILD FAILED
Information:Total time: 27.738 secs
Information:1 error
Information:3 warnings
Information:See complete output in console

事实上,在添加这些依赖项之前,一切正常,没有错误。你知道是什么问题吗?!预先感谢您的帮助!

4

1 回答 1

1

最后我可以解决问题。清洁和重建项目不是解决方案!我没有通过在 Gradle 中编写代码来添加依赖项。事实上,我从以下链接下载了 Jar 库:http: //mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-android/1.5

我下载了三个我需要的库:

hapi-fhir-structures-dstu2-1.5.jar , hapi-fhir-base-1.5.jar , hapi-fhir-android-1.5.jar

然后我将它们移动到应用程序的“lib”文件夹->同步 gradle

于 2016-06-14T16:53:00.600 回答