0

This is my Gradle:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    //compile fileTree(include: ['*.jar'], dir:'libs/hapi-fhir-1.4-android-distribution')
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.android.support:percent:23.1.1'
    compile 'com.android.support:support-annotations:23.1.1'
    compile 'com.jjoe64:graphview:4.0.1'
    compile files('libs/activation.jar')
    compile files('libs/additionnal.jar')
    compile files('libs/mail.jar')
    compile 'com.android.support:multidex:1.0.1'
    compile group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.5.1'
    testCompile 'junit:junit:4.12'


    compile 'ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:1.5'
    compile group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-android', version: '1.5'
    compile group: 'org.slf4j', name: 'slf4j-android', version: '1.7.12'
    /*compile 'javax.xml.stream:stax-api:1.0-2'*/
}


configurations {
    compile.exclude module: 'javax.json'
    compile.exclude group: 'org.apache.httpcomponents', module: "httpcore"
    runtime.exclude group: 'org.apache.httpcomponents', module: "httpcore"
}

this is the error:

Information:Gradle tasks [:app:assembleDebug]
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 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 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 UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithJarMergingForDebug UP-TO-DATE
:app:collectDebugMultiDexComponents UP-TO-DATE
:app:transformClassesWithMultidexlistForDebug UP-TO-DATE
:app:transformClassesWithDexForDebug
trouble processing "javax/xml/stream/EventFilter.class":
Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.
This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.
However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.
If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.
If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.
If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.
1 error; aborting
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 '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 1 mins 5.901 secs
Information:1 error
Information:3 warnings
Information:See complete output in console

I have : minifyEnabled set to false, and multiDexEnabled set to true, and javaMaxHeapSize set to "4g".

in addition I've tried following ways but still the error exists:

  • Clean and rebuild the project

  • invalidate caches and restart

  • remove /build and app/build

I don't know what to do to overcome this annoying problem. would you please give me a hand to solve it?!

Jasmine
  • 222
  • 2
  • 12
  • probably you have the httplib client added explicitly which are added by default in framework so try removing them. – Shubhank Jun 17 '16 at 17:58
  • @Shubhank in libs folder I have only following jar files: activation, additionnal, mail, aws-android-sdk-cognito-2.2.9, aws-android-sdk-core-2.2.9 , and aws-android-sdk-ec2-2.2.9 – Jasmine Jun 17 '16 at 18:15
  • can you show the project structure (libs and jars added) – Shubhank Jun 17 '16 at 18:16
  • @Shubhank I've already mentioned in previous comment. – Jasmine Jun 17 '16 at 18:20
  • try checking these links http://stackoverflow.com/questions/35313477/dependency-org-apache-httpcomponentshttpclient4-5-is-ignored-for-debug-as-it-m http://stackoverflow.com/questions/32930966/apache-http-client-error-with-json-version-provided-by-android – Shubhank Jun 17 '16 at 18:21

0 Answers0