Gradle Exclude or add reference for JAR file hard included inside library classes.jar

后端 未结 2 948
别那么骄傲
别那么骄傲 2020-12-11 18:55

I\'m running into some trouble with a library I included into my project: At the beginning it was just a conflicting dependencies issue that I resolved by excluding

相关标签:
2条回答
  • 2020-12-11 19:05

    At Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat it easy as exclude module: 'support-v4'

    example

    dependencies {
        compile('com.commonsware.cwac:camera-v9:0.5.4') {
          exclude module: 'support-v4'
        }
    
        compile 'com.android.support:support-v4:18.0.+'
    }
    
    0 讨论(0)
  • 2020-12-11 19:20

    Try to use resolutionStrategy (API reference) at root build.gradle.

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.0.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
        }
        configurations.all((Closure) {
            resolutionStrategy {
                force 'com.android.support:support-v4:21.0.2' // your version of support library
            }
        })
    
    }
    
    0 讨论(0)
提交回复
热议问题