All the libraries must use the same versions

后端 未结 2 812
天命终不由人
天命终不由人 2020-12-20 06:57

My depencies

dependencies {
compile \'me.dm7.barcodescanner:zxing:1.9\'
implementation fileTree(dir: \'libs\', include: [\'*.jar\'])
implementation \'com.and         


        
2条回答
  •  -上瘾入骨i
    2020-12-20 07:28

    There are conflicted dependencies in your project. You need to check up the dependencies tree of your project by running the following command in your Linux terminal:

    ./gradlew app:dependencies
    

    or if you're using Windows:

     gradlew app:dependencies
    

    in your root project. Where app is your module name.

    Quick checking your dependencies block, you will find the following library:

    compile 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
    

    is using support library version 27.1.1 for its dependencies (You can check its build.gradle).

    You can exclude the library from image cropper with:

    implementation ('com.theartofdev.edmodo:android-image-cropper:2.7.0') {    
        exclude group: 'com.android.support'
        exclude module: 'appcompat-v7'
    }
    

    The side effect of using the old version of support library is you can't be so sure that your program will work correctly. It's because the owner of library probably didn't test the library with older version of support library.

    The better way is by changing your BuildToolsVersion, compileSdkVersion, targetSdkVersion, and support libraries to version 27. Something like the following:

    android {
      compileSdkVersion 27
      buildToolsVersion '27.0.3'
    
      defaultConfig {
        applicationId "com.package.name"
        minSdkVersion 15
        targetSdkVersion 27
    
        ...
      }
    
      ...
    }
    
    dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
    
      implementation 'com.android.support:appcompat-v7:27.1.1'
      implementation 'com.android.support:design:27.1.1'
    
      // your other dependencies
      ...
    }
    

提交回复
热议问题