Android错误:任务';的执行失败:app:transformclasses与dexfordebug';
我在androidstudio的android项目中工作过,当我开始运行gradlebuild时,显示了以下错误。有人帮我吗?有什么问题吗 错误:任务“:app:transformClassesWithDexForDebug”的执行失败。 com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.exeception:process'command'/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/Java''以非零退出值3结束 build.gradleAndroid错误:任务';的执行失败:app:transformclasses与dexfordebug';,android,android-studio,build.gradle,Android,Android Studio,Build.gradle,我在androidstudio的android项目中工作过,当我开始运行gradlebuild时,显示了以下错误。有人帮我吗?有什么问题吗 错误:任务“:app:transformClassesWithDexForDebug”的执行失败。 com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.exe
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.stage.lookara"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile files('libs/twitter4j-core-4.0.4.jar')
compile files('libs/slider.jar')
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.etsy.android.grid:library:1.0.5'
compile 'com.baoyz.swipemenulistview:library:1.3.0'
compile files('libs/universal-image-loader-1.9.5.jar')
compile 'com.github.darsh2:MultipleImageSelect:v0.0.3'
compile files('libs/pherialize-1.2.1.jar')
compile 'com.wang.avi:library:2.1.3'
compile 'com.mikhaellopez:circularprogressbar:1.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile
'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
compile 'com.felipecsl:gifimageview:2.1.0'
}
repositories {
jcenter()
}
dependencies {
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile 'org.jsoup:jsoup:1.7.3'
}
先尝试清洁
如果不起作用,请将multiDexEnabled添加到build.gradle文件中
defaultConfig {
multiDexEnabled true
}
请参见:您正在编译整个Google play服务库:
compile 'com.google.android.gms:play-services:8.3.0'
在编译过程中可能会超过64K参考限制'
看
如果你只是使用图书馆的一些服务,你可以
比如:
我还建议使用最新版本的play servicescompile'com.google.android.gms:play services:10.2.1'
第二条道路
如果确实要使用整个库:在应用程序中启用Multidex
在你的毕业典礼上:
android {
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 25
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
在应用程序类中:
public class MyApplication extends SomeOtherApplication {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
在清单中定义应用程序类:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application
android:name="android.support.multidex.MultiDexApplication" >
...
</application>
</manifest>
...
实现dex并将这一行multiDexEnabled true
放入您的构建中。gradleSee此链接。打开IDE右下角的“Gradle console”,将有有关此问题的更多信息。请阅读
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application
android:name="android.support.multidex.MultiDexApplication" >
...
</application>
</manifest>