首页 > 解决方案 > 复制 Volley.jar,添加 linkedIn SDK 后,复制 zip 条目 [ik.class == volley.jar:com/android/volley/AuthFailureError.class]

问题描述

添加linkedIn SDK后,我无法构建发布apk,它说

重复的 zip 条目 [ik.class == volley.jar:com/android/volley/AuthFailureError.class]

我的应用程序 build.gradle:

android{
...
dependencies{
...
compile 'com.mcxiaoke.volley:library:1.0.18'//required for app
}
dependencies {
        compile project(path: ':linkedin-sdk', configuration: 'default')
    }
}

链接在 build.gradle 中:

allprojects {
    repositories {
        mavenCentral()
    }
}

buildscript {
   repositories {
     mavenCentral()
   }

}

apply plugin: 'android-library'

android {
    sourceSets {
        androidTest {
          setRoot('src/test')
        }
    }
    compileSdkVersion 26
    buildToolsVersion '27.0.3'

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        packagingOptions{}
    }
    lintOptions {
          abortOnError false
    }
}

configurations {
}


dependencies {
    compile 'com.android.support:support-annotations:20.0.0'
    compile 'com.android.support:support-v4:26.0.+'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/volley.jar') // linkedIn has it
    androidTestCompile('junit:junit:4.12')
}

添加了proguard项目:

-keep class com.android.volley.** { *; }
-keep class org.apache.commons.logging.**
-keepattributes *Annotation*
-dontwarn org.apache.**

-keep class com.linkedin.** { *; }
-keepattributes Signature

我想将已经存在的 volley.jar 用于linkedIn,我该怎么做

标签: androidsdklinkedin

解决方案


推荐阅读