当我运行集成了 Creative sdk 以进行照片编辑选项的应用程序时,出现以下错误。
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: android/support/multidex/MultiDex$V14.class
这是我的应用程序 gradle 文件。此处集成了用于图像编辑选项的创意 sdk 并启用了 multidex 选项。
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.ileaf.cameraeffects"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
res.srcDirs = ['src/main/res', 'src/main/res/drawable-hdpi', 'src/main/res/drawable-mdpi', 'src/main/res/drawable-xhdpi', 'src/main/res/anim']
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
// jumboMode true
incremental true
preDexLibraries false
// javaMaxHeapSize "4g"
}
}
allprojects {
apply plugin: 'maven'
tasks.withType(JavaCompile) {
options.incremental = true
}
repositories {
mavenCentral()
jcenter()
maven {
url "${project.rootDir}/creativesdk-repo/release" // The base location of Creative SDK
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
// compile 'com.adobe.creativesdk.foundation:assets:0.4.264'
compile 'com.adobe.creativesdk:image:4.0.0'
compile 'com.android.support:multidex:1.0.1'
}
这是我的应用程序应用程序类。
package com.ileaf.cameraeffects;
import android.support.multidex.MultiDexApplication;
import com.aviary.android.feather.sdk.IAviaryClientCredentials;
public class MyApplication extends MultiDexApplication implements IAviaryClientCredentials {
@Override
public void onCreate() {
super.onCreate();
}
@Override
public String getBillingKey() {
return "";
}
@Override
public String getClientID() {
return "";
}
@Override
public String getClientSecret() {
return "";
}
}