More than one file was found with OS independent path 'META-INF/rxjava.properties'

  • 今天运行项目突然爆这个错误,很是惊讶,网上搜索都是差不多的解决思路:
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.function.luo.androidcollection"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
   /**
     *加上这段话,即可
    */
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
    }

也有加入其它方法的 (两种任选其一)

  • 法法一:
 packagingOptions {//加上这写代码
        pickFirst 'META-INF/*'

}

  • 法法二:
  packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
    }

总结:

  • 在 build.gradle加入,sync Now 同步一下,即可

你可能感兴趣的:(More than one file was found with OS independent path 'META-INF/rxjava.properties')