Code Monkey home page Code Monkey logo

Comments (16)

MarinKacaj avatar MarinKacaj commented on May 27, 2024

I have the same problem.
Gradle 2.1.2

from gradle-download-task.

scottdermott avatar scottdermott commented on May 27, 2024

I think the issue is caused by JDK Version. I am using 1.79

from gradle-download-task.

MarinKacaj avatar MarinKacaj commented on May 27, 2024

I tried adding this to the dependencies:
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.4.1'
I get a warning that it may conflict with Android's internal library. When building, I get a java.lang.NoSuchFieldException for INSTANCE.

from gradle-download-task.

michel-kraemer avatar michel-kraemer commented on May 27, 2024

Interesting. I haven't had this problem before. @scottdermott please use the workaround from @MarinKacaj for the time being. I'll look into the issue and try to fix it in the meantime.

from gradle-download-task.

michel-kraemer avatar michel-kraemer commented on May 27, 2024

Just to be on the safe side: can you send me a minimum example build.gradle demonstrating the error, so I can reproduce it? Thanks!

from gradle-download-task.

MarinKacaj avatar MarinKacaj commented on May 27, 2024

build.zip
This is the app module level build.gradle.
I'm using:

  • Android Studio 2.1.2.
  • JRE: 1.8.0_65-b17 amd64
  • Windows 10

Hope this helps.
P.S.: Inside build.gradle replace "whatever" as appropriate with your test URLs, names, etc. Thank you.

from gradle-download-task.

michel-kraemer avatar michel-kraemer commented on May 27, 2024

Thanks for the build file. However, it's not a minimal example. It's a rather complex one. I wasn't able to get it running. Can you try to reproduce the error without all the Android stuff? Thanks for your support.

from gradle-download-task.

vanniktech avatar vanniktech commented on May 27, 2024

Getting the same here what are you missing for fixing this?

from gradle-download-task.

michel-kraemer avatar michel-kraemer commented on May 27, 2024

It would be perfect if I could reproduce it. It works in all of my build files. If I can't reproduce it I can't fix it, unfortunately. :-/

from gradle-download-task.

vanniktech avatar vanniktech commented on May 27, 2024

Hmm my problem was that I declared everything in a subproject. When I moved everything to the root build.gradle file everything works now. Weird :/

from gradle-download-task.

scottdermott avatar scottdermott commented on May 27, 2024

I can confirm, by moving download tasks to the root build.gradle this resolves the issue.
It appears that if the Android gradle plugin is applied within the same build.gradle
apply plugin: 'com.android.application'
The issue is present

from gradle-download-task.

michel-kraemer avatar michel-kraemer commented on May 27, 2024

Interesting. Thanks for posting your solution (i.e. workaround). Let me know if there is anything I can do in gradle-download-task to mitigate this issue. But I suspect it has probably something to do with the way how Gradle manages plugin classpaths.

from gradle-download-task.

dolmens avatar dolmens commented on May 27, 2024

Yes, By moving the dependency 'de.undercouch:gradle-download-task:3.1.1' to root build.gradle solve this problem.

from gradle-download-task.

linsea avatar linsea commented on May 27, 2024

@MarinKacaj I met the same problem, have you fixed it?
@michel-kraemer moving dependency to the top level build.gradle did not fix my problem. I have a buildSrc project, which use android gradle transform API, i.e. the android gradle plugin, which dependency httpclient 4.1.1, but gradle-download-task plugin use httpclient 4.5.2. I think this is the core reason, when building, gradle use the former version, not the higher version, why ?

in order to override the dependency, I need to declare a higher version of httpclient in my buildSrc project:

dependencies {
    compile localGroovy()
    compile gradleApi()

//override httpclient dependency of com.android.tools.build:gradle:2.2.3
    compile 'org.apache.httpcomponents:httpclient:4.5.2'  

    compile 'com.android.tools.build:gradle:2.2.3'

}

after that, build successful. hope this helpful to some one.

from gradle-download-task.

michel-kraemer avatar michel-kraemer commented on May 27, 2024

Please follow #75. I think it's the same issue. I'm trying to reproduce it and find a solution. I'll post updates in the other thread as this one is already closed.

from gradle-download-task.

michel-kraemer avatar michel-kraemer commented on May 27, 2024

@PashaTurok Please open a new issue instead of commenting on an old one. Please also include the version of gradle-download-task you are using. Thanks.

from gradle-download-task.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.