java - :app:transformClassesWithJarMergingForDebug失败(未使用jsonpath)

标签 java android gradle

在为模拟器v4.1.1编译android项目时出现以下错误。我也无法生成apk。下面是错误和我的gradle文件。

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:org / objectweb / asm / AnnotationVisitor.class
 apply plugin: 'com.android.application'
 android {
 packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/BCKEY.DSA'
    exclude 'AUTHORS'
    exclude 'META-INF/services/javax.annotation.processing.Processor'
    exclude 'META-INF/BCKEY.SF'
    pickFirst 'META-INF/maven/com.google.guava/guava/pom.properties'
    pickFirst 'META-INF/maven/com.google.guava/guava/pom.xml'
    pickFirst 'META-INF/maven/net.minidev/accessors-smart/pom.properties'
    pickFirst 'META-INF/maven/net.minidev/accessors-smart/pom.xml'

}
 signingConfigs {
    config {
        keyAlias '********'
        keyPassword '********'
        storeFile file('C:/Users/Prasang/Downloads/***/****.jks')
        storePassword '********'
    }
}
 compileSdkVersion 23
 buildToolsVersion "23.0.3"
 defaultConfig {
 applicationId "com.**********"
 minSdkVersion 15
 targetSdkVersion 23
 versionCode 7
 versionName "7.0"
 multiDexEnabled true

}
 buildTypes {
 release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'

    }
}
 dexOptions {
    incremental = true;
    preDexLibraries = false
    javaMaxHeapSize "4g"
 }
 repositories {
  jcenter()
  maven { url "https://jitpack.io" }
  mavenCentral()}
 dependencies {
// compile 'net.minidev:json-smart:2.2'
testCompile 'junit:junit:4.12'
compile files('libs/red5streaming.jar')
compile files('libs/mina-core-2.0.7.jar')
//compile 'fm.jiecao:jiecaovideoplayer:3.4'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile fileTree(include: ['*.java'], dir: 'libs')
compile fileTree(include: ['*.so'], dir: 'libs')
//compile files('libs/red5pro-1.0.2.jar')
// compile 'me.yifeiyuan.periscopelayout:library:1.0.0'
compile 'com.parse:parse-android:1.10.3'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
//compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.4.0'
compile 'com.koushikdutta.ion:ion:2.+'
compile 'com.wrapp.floatlabelededittext:library:0.0.6'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.github.orangegangsters:swipy:1.2.1@aar'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'com.github.afollestad.material-dialogs:core:0.8.5.6@aar'
// compile 'com.android.support:support-v4:24.0.0'
compile 'com.github.rtoshiro.fullscreenvideoview:fullscreenvideoview:1.1.0'
compile 'org.apache.commons:commons-lang3:3.0'
compile 'com.github.jd-alexander:LikeButton:0.1.8'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.github.kanytu:android-parallax-recyclerview:v1.7'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:percent:23.2.0'
compile 'com.google.android.gms:play-services-ads:9.0.2'
compile 'com.google.android.gms:play-services-auth:9.0.2'
compile 'com.google.android.gms:play-services-gcm:9.0.2'
compile 'com.google.gms:google-services:2.0.0-alpha6'
 }
apply plugin: 'com.google.gms.google-services'}

最佳答案

可能与google-play-services冲突

删除这个

compile 'com.google.android.gms:play-services:9.0.2'



只留下了这部分

compile 'com.google.android.gms:play-services-ads:9.0.2' compile 'com.google.android.gms:play-services-auth:9.0.2' compile 'com.google.android.gms:play-services-gcm:9.0.2'



同时尝试清理/重建项目

关于java - :app:transformClassesWithJarMergingForDebug失败(未使用jsonpath),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38036615/

相关文章:

java - Hibernate @OneToMany/@ManyToOne 列未出现

选中和取消选中时Android更改选项卡栏文本颜色

android - 从 Eclipse 移植和升级 Android 库

java - 有没有办法使用 Gradle 将 Java/Groovy 与 Haskell 集成?

android - 网格布局列跨度不起作用

android-studio - 为什么 gradle 2.0 这么慢?

java - Java 泛型中 "super"通配符的详细信息

java - 实例化 Java AWT 对象会导致在 macOS 上打开空应用程序

java - 线性数组的二叉树构造函数

android - StaggeredGridLayoutManager 和移动项目