Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将HAPI-FHIR依赖项添加到gradle Android项目中_Java_Android_Gradle_Hapi Fhir - Fatal编程技术网

Java 将HAPI-FHIR依赖项添加到gradle Android项目中

Java 将HAPI-FHIR依赖项添加到gradle Android项目中,java,android,gradle,hapi-fhir,Java,Android,Gradle,Hapi Fhir,我试图将以下依赖项添加到我的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:slf4

我试图将以下依赖项添加到我的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
事实上,在添加这些依赖项之前,一切都运行良好,没有错误。 你知道有什么问题吗?!
提前感谢您的帮助

我终于可以解决这个问题了。清洁和重建项目不是解决方案! 我没有通过在Gradle中编写代码来添加依赖项。 事实上,我从以下链接下载了Jar库:

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

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


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

是否打开了proguard?这可能没有帮助,但可能尝试清理项目并重建?@AritraRoy我如何打开它?@Robertsimes我确实清理了项目,但它不起作用!你为什么不使用Android依赖项?