android jar meta inf,android – 在操作系统独立路径’META-INF / L...

当我构建我的应用程序时,我得到了跟随错误.

Error:Execution failed for task ‘:app:transformResourcesWithMergeJavaResForDebug’.

More than one file was found with OS independent path ‘META-INF/LICENSE’

这是我的build.gradle文件

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

android {

compileSdkVersion 25

buildToolsVersion "25.0.2"

defaultConfig {

applicationId "cn.sz.cyrus.kotlintest"

minSdkVersion 14

targetSdkVersion 25

versionCode 1

versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

javaCompileOptions{

annotationProcessorOptions{

includeCompileClasspath = true

}

}

multiDexEnabled true

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

packagingOptions {

/* exclude 'META-INF/DEPENDENCIES'

exclude 'META-INF/NOTICE'

exclude 'META-INF/LICENSE'

exclude 'META-INF/LICENSE.txt'

exclude 'META-INF/NOTICE.txt'*/

}

}

dependencies {

compile fileTree(include: ['*.jar'], dir: 'libs')

androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {

exclude group: 'com.android.support', module: 'support-annotations'

})

compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

compile 'com.android.support:appcompat-v7:25.3.1'

testCompile 'junit:junit:4.12'

compile 'com.android.support:design:25.3.1'

compile 'com.android.support.constraint:constraint-layout:1.0.2'

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'

releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'

testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'

compile 'com.github.GrenderG:Toasty:1.2.5'

compile 'com.orhanobut:logger:1.15'

compile 'io.reactivex.rxjava2:rxandroid:2.0.1'

compile 'com.umeng.analytics:analytics:latest.integration'

compile 'ai.api:libai:1.4.8'

compile 'ai.api:sdk:2.0.5@aar'

// api.ai SDK dependencies

compile 'com.google.code.gson:gson:2.8.0'

compile 'commons-io:commons-io:2.4'

compile 'com.android.support:multidex:1.0.1'

}

当我将这些代码添加到我的gradle文件中时.

packagingOptions {

exclude 'META-INF/DEPENDENCIES'

exclude 'META-INF/NOTICE'

exclude 'META-INF/LICENSE'

exclude 'META-INF/LICENSE.txt'

exclude 'META-INF/NOTICE.txt'

}

这个错误将被解决,但另一个问题将会发生.像这样

java.lang.NoClassDefFoundError: com.squareup.leakcanary.internal.HeapAnalyzerService

at com.squareup.leakcanary.LeakCanary.isInAnalyzerProcess(LeakCanary.java:145)

at cn.sz.cyrus.wemz.TestApplication.onCreate(TestApplication.kt:32)

谁有想法如何解决这个问题?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值