Android dependency ignored for release

I get a lot of these warnings when creating my project using gradle. I can see https://stackoverflow.com/a/167238/2122323 ... but I don’t understand how to silence them. It sounds like any version of these things, depending on what I'm fine, is tidied up in favor of the version packaged in android.jar.

I believe that everything is in order, but I really would like to close them so that the things that I see are real problems.

So, in particular, I'm curious:

  • Does this indicate a problem? It seems, definitely not.
  • How do I close this?
  • Do not everyone see this set of warnings? I am skeptical that the whole world of people using gradle + android.Log sees this set of warnings.
WARNING: Dependency commons-logging:commons-logging:1.1.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 commons-logging:commons-logging:1.1.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 commons-logging:commons-logging:1.1.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 WARNING: Dependency commons-logging:commons-logging:1.1.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 WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debugTest 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 commons-logging:commons-logging:1.1.1 is ignored for debugTest 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 commons-logging:commons-logging:1.1.1 is ignored for robolectric 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 commons-logging:commons-logging:1.1.1 is ignored for robolectric 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 commons-logging:commons-logging:1.1.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 commons-logging:commons-logging:1.1.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 commons-logging:commons-logging:1.1.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 WARNING: Dependency commons-logging:commons-logging:1.1.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 WARNING: Dependency commons-logging:commons-logging:1.1.1 is ignored for debugTest 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.0.3 is ignored for debugTest 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 
+44
android
Aug 13 '14 at 19:59
source share
2 answers

I am not sure if this can create problems. It is best to do this in order to follow the recommendations in the warning or completely eliminate the addiction (your point number 2, to which I answered below).

I also saw these warnings, in particular, “publicly available”.

Which answer in the thread you are referencing says that you should ignore these dependencies, since the Android APIs already include them (I think, correct me if I am wrong).

For example, if you specifically require commons-logging (or another that gives a similar warning), remove it from your list.

build.gradle file:

 dependencies { ... compile 'commons-logging:commons-logging:1.1.3' #Remove this line; you don't need it. .... } 

In addition, if you have a dependency that requires coupling as a transitive dependency, you should also exclude it.

Example:

 dependencies { ... compile 'some.package.that:requires_commons_logging:1.2.3' .... } 

becomes

 dependencies { ... compile ('some.package.that:requires_commons_logging:1.2.3') { exclude group: 'commons-logging', module: 'commons-logging' } .... } 

An easy way to completely exclude it can be done by adding this to your build.gradle file, without excluding it in each dependency:

 configurations { all*.exclude group: 'commons-logging', module: 'commons-logging' } 

Finally, to look at the dependency tree (and see that each of your dependencies transitively imports independently, which can conflict, which can be very useful), use this command from the root of your project:

 ./gradlew :your_module_name:dependencies 
+83
Aug 22 '14 at 18:36
source share

If you want to disable warnings, you must add this to your build.gradle for each dependency:

 exclude group: 'org.apache.httpcomponents', module: 'httpclient' 

This will:

 dependencies { ... compile ('some.package.that:requires_commons_logging:1.2.3') { exclude group: 'commons-logging', module: 'commons-logging' } .... } 
+9
Jan 25 '16 at 2:59
source share



All Articles