3

I'm getting the following warning

Warning:Dependency commons-logging:commons-logging:1.2 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

The dependency "commons-logging:commons-logging:1.2" is not even in my gradle file.

nbro
  • 15,395
  • 32
  • 113
  • 196

2 Answers2

5

I think you should exclude commons-logging from any dependency that includes it. It's gonna be like this:

compile ('<name-of-the-package-that-has-as-dependency-commons-logging>') {
    exclude group: 'commons-logging', module: 'commons-logging'
}
nbro
  • 15,395
  • 32
  • 113
  • 196
Shadan Golestan
  • 106
  • 1
  • 6
  • As in this example that I am using to guard against org.apache.httpcomponents: `code' compile 'com.google.guava:guava:23.0-android' compile ('org.apache.httpcomponents:httpclient:4.5.5') { exclude group: 'commons-logging', module: 'commons-logging' } compile (group: 'org.apache.httpcomponents' , name: 'httpclient- android' , version: '4.3.5.1') { exclude group: 'commons-logging', module: 'commons-logging' } compile files('libs/common-lang3.jar') `code` – Gogu CelMare Apr 24 '18 at 00:10
0
apply plugin: 'com.android.application'android {   
 compileSdkVersion 22    
 buildToolsVersion "22.0.1"    
 defaultConfig {        
 applicationId "com.milople.useraudio"        
 minSdkVersion 15        
 targetSdkVersion 22       
 versionCode 1       
 versionName "1.0"       
 multiDexEnabled true    
}  
  packagingOptions {        
             exclude 'META-INF/LICENSE.txt'      
             exclude 'META-INF/NOTICE.txt'      
  }   
 buildTypes {        
            release {            
                 minifyEnabled true            
proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'       
 }   
 }      
compileOptions {          
sourceCompatibility JavaVersion.VERSION_1_7      
targetCompatibility JavaVersion.VERSION_1_7    
}}
buildscript {    
repositories{ 
           maven { url 'https://maven.fabric.io/public' }           
}
dependencies {       
 classpath 'io.fabric.tools:gradle:1.+'    
}}
apply plugin: 'io.fabric'repositories { 
   maven { url 'https://maven.fabric.io/public' }}
dependencies {    
compile fileTree(dir: 'libs', include: ['*.jar'])    
compile 'com.android.support:appcompat-v7:22.0.0+'   
compile 'com.android.support:recyclerview-v7:22.1.1'    
compile 'com.android.support:cardview-v7:22.1.1'    
compile files('libs/PayPalAndroidSDK-2.9.8.jar')   
compile 'de.hdodenhof:circleimageview:1.2.1'    
compile 'com.google.code.gson:gson:2.3.1'    
compile 'com.facebook.android:facebook-android-sdk:4.1.0'     
compile('com.twitter.sdk.android:twitter:1.7.2@aar') {
transitive = true;    
}    
compile 'com.google.android.gms:play-services:6.5.87'    
compile 'com.eftimoff:android-pathview:1.0.6@aar'   
compile 'com.dwolla:dwolla-java-sdk:2.0.5'   
compile 'org.apache.httpcomponents:httpmime:4.2.5'
compile 'com.sothree.slidinguppanel:library:3.1.1'  
compile 'com.squareup:otto:1.3.5'  
}
Ando Masahashi
  • 3,112
  • 2
  • 24
  • 41