gpt4 book ai didi

java - Android Studio错误:任务执行失败:app:transformClassesWithDexForDebug

转载 作者:行者123 更新时间:2023-12-03 06:05:33 25 4
gpt4 key购买 nike

我在android studio中收到此错误

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException:
Process 'command 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' finished with non-zero exit value 1

build.gradle文件是
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'


repositories {
maven {
url "https://mint.splunk.com/gradle/"
}
}

repositories {
maven { url 'https://maven.fabric.io/public' }

}


android {
// useLibrary 'org.apache.http.legacy'
useLibrary 'org.apache.http.legacy'
//compileSdkVersion 23
// buildToolsVersion '23.0.2'
compileSdkVersion 23
buildToolsVersion '23.0.2'


defaultConfig {
applicationId "com.tankkk"
minSdkVersion 16
targetSdkVersion 21
versionCode 38
versionName "4.8"
// Enabling multidex support.
multiDexEnabled true
}


packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}


dexOptions {
incremental true
javaMaxHeapSize "2048M"
}

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

sourceSets {
main {
jniLibs.srcDir 'src/main/jniLibs'
}
}


}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// compile project(':vitamio')
//compile project(':recorder')
compile project(':videorecording')
compile project(':cropper')
compile('com.crashlytics.sdk.android:crashlytics:2.5.1@aar') {
transitive = true;
}
compile('com.twitter.sdk.android:twitter:1.7.2@aar') {
transitive = true;
}
// compile 'com.danikula:videocache:1.0.1'
// compile 'com.danikula:videocache:2.3.4'
// compile 'com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.2.5'
//compile 'net.gotev:uploadservice:2.0'
compile project(':recorder')
//compile 'com.android.support:support-v4:24.0.0-aplha1'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'com.timehop.stickyheadersrecyclerview:library:0.4.3'
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'com.kyleduo.switchbutton:library:1.2.8'
compile 'com.google.android.gms:play-services-base:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.baoyz.swipemenulistview:library:1.2.1'
compile 'com.splunk.mint:mint:4.4.0'
compile 'com.google.android.exoplayer:exoplayer:r1.5.4'
compile 'it.sephiroth.android.library.targettooltip:target-tooltip-library:+'
//compile 'net.gotev:uploadservice:2.1'
compile project(':uploadservice')
}

最佳答案

dexOptions {
incremental true
javaMaxHeapSize "4g"
}

在gradle的android括号中放上一行,然后在LAUNCHER Activity的onCreate的开头放下几行。
    MultiDex.install(this);

之后,从Build-> Clean Project清除项目。

这样可以解决您的问题。

关于java - Android Studio错误:任务执行失败:app:transformClassesWithDexForDebug,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39071979/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com