-->

Warning:Dependency org.apache.httpcomponents:httpc

2019-08-15 07:31发布

问题:

I'm getting quite a lot a problems by creating an external android library using the JFrog plugin. Essentially it keeps trying to get dependencies from apache without me asking for them. It seems related to the plugins that I'm applying with gradle. If I try to use this library in my app and try to run it using the local maven repo, it lasts a really a long time and then I get these warnings:

Information:Gradle tasks [clean, :generateDebugSources, >:generateDebugAndroidTestSources, :compileDebugSources, >:compileDebugAndroidTestSources]

Warning:Dependency org.apache.httpcomponents:httpclient:4.2.1 is ignored >for debug as it may be conflicting with the internal version provided by >Android.

and at the end I get errors:

com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:262)
        at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:294)
        at com.android.dx.cf.cst.ConstantPoolParser.parse(ConstantPoolParser.java:150)
        at com.android.dx.cf.cst.ConstantPoolParser.parseIfNecessary(ConstantPoolParser.java:124)
        at com.android.dx.cf.cst.ConstantPoolParser.getPool(ConstantPoolParser.java:115)
        at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:482)
        at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
        at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
        at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
        at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
        at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
        at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
        at com.android.dx.command.dexer.Main.processClass(Main.java:749)
        ... 12 more
    Error:java.lang.IllegalArgumentException: bad utf-8 byte a0 at offset 00000004
        at com.android.dx.rop.cst.CstString.throwBadUtf8(CstString.java:171)
        at com.android.dx.rop.cst.CstString.utf8BytesToString(CstString.java:143)
        at com.android.dx.rop.cst.CstString.<init>(CstString.java:200)
        at com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:371)
        ... 25 more
    1 error; aborting
    Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
    > 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

<!-- end snippet -->

And I have already searched through stackoverflow and other sites but I can't find an answer. The solution presented in Incomprehensible error starting the project (gradle) doesn't work for me. My gradle file you can see here: https://raw.githubusercontent.com/jesperancinha/lib-chartizate-sz/master/chartizate-text-writer-android/build.gradle. I have already seen that JFrog and android-maven gradle plugins seem to be the culprits because it's only when I add them that I start to have problems.

回答1:

Check, I just figured out what the propblem was, and now I'm wondering if the problem for Incomprehensible error starting the project (gradle) was the same. Essentially my classpath had the maven plugin, the jfrog plugin and also the gradle plugin in it, which essentially was making a lot of recursive calls and making these plugins part of the actual build. It is now fixed and I'm closing this issue.