【问题标题】:Dependency commons-logging:commons-logging:1.2 is ignored for debug as it may be conflicting with the internal version provided by Android依赖 commons-logging:commons-logging:1.2 被忽略调试,因为它可能与 Android 提供的内部版本冲突
【发布时间】:2015-11-22 15:14:19
【问题描述】:

我收到以下警告

警告:依赖 commons-logging:commons-logging:1.2 被忽略 调试,因为它可能与提供的内部版本冲突 安卓。如有问题,请用jarjar重新打包以更改类包

依赖项“commons-logging:commons-logging:1.2”甚至不在我的 gradle 文件中。

【问题讨论】:

    标签: android gradle runtime-error


    【解决方案1】:

    我认为您应该从包含它的任何依赖项中排除 commons-logging。会是这样的:

    compile ('<name-of-the-package-that-has-as-dependency-commons-logging>') {
        exclude group: 'commons-logging', module: 'commons-logging'
    }
    

    【讨论】:

    • 在这个例子中,我用来防范 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`
    【解决方案2】:
    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'  
    }
    

    【讨论】:

      猜你喜欢
      • 2015-07-03
      • 2015-12-31
      • 2016-05-20
      • 1970-01-01
      • 2015-08-25
      • 1970-01-01
      • 2015-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多