相关疑难解决方法(0)

找不到参数[{module = support-v4}]的方法exclude()

我试图在关闭即时运行的情况下运行我的应用程序,但是我收到此错误:

错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败.

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android/support/v4/view/KeyEventCompatEclair.class

这是我的gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.jua.app"
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile project(path: ':app_Data')
    compile files('libs/android-support-v4.jar')
}
Run Code Online (Sandbox Code Playgroud)

我尝试了这个线程的解决方案:

compile files('libs/android-support-v4.jar'){
    exclude module: "support-v4"
}
Run Code Online (Sandbox Code Playgroud)

现在,当我尝试同步gradle.build时,我收到此错误:

错误:(29,0)无法在org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection类型的文件集合中找到参数[{module = support-v4}]的方法exclude().打开文件

我现在有点失落,如果有人知道如何解决这个问题我会很感激.

编辑

我删除了

编译文件('libs/android-support-v4.jar')

完全,我仍然得到第一个错误.

java android gradle build.gradle

5
推荐指数
2
解决办法
6326
查看次数

标签 统计

android ×1

build.gradle ×1

gradle ×1

java ×1