错误 错误:任务':app:transformClassesWithMultidexlistForDebug'执行失败。
com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process' command' C:\ Program Files \ Java \ jdk1.7.0_79 \ bin \ java.exe''完成非零退出值1
我的gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0 rc3"
defaultConfig {
applicationId "com.example.sagar.shavanma"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
Gridle
:app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :应用:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2330Library UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72330Library UP-TO-DATE :app:prepareComAndroidSupportCardviewV72330Library UP-TO-DATE :app:prepareComAndroidSupportDesign2330Library UP-TO-DATE :app:prepareComAndroidSupportMultidex101Library UP-TO-DATE :app:prepareComAndroidSupportRecyclerviewV72330Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42330Library UP-TO-DATE :app:prepareComAndroidSupportSupportVectorDrawable2330Library UP-TO-DATE :app:prepareComAndroidVolleyVolley100Library UP-TO-DATE :app:prepareComGithubNirhartParallaxscroll10Library UP-TO-DATE :应用:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE :应用:compileDebugJavaWithJavac 注意:某些输入文件使用或覆盖已弃用的API。 注意:使用-Xlint重新编译:弃用以获取详细信息。 注意:某些输入文件使用未经检查或不安全的操作。 注意:使用-Xlint重新编译:取消选中以获取详细信息。 :app:compileDebugNdk UP-TO-DATE :应用:compileDebugSources :应用:prePackageMarkerForDebug :应用:transformClassesWithJarMergingForDebug :应用:collectDebugMultiDexComponents :应用:transformClassesWithMultidexlistForDebug ProGuard,版本5.2.1 阅读程序jar [G:\ Projects \ Shavanma \ app \ build \ intermediates \ transforms \ jarMerging \ debug \ jars \ 1 \ 1f \ combined.jar] 读取库jar [C:\ Users \ shree \ AppData \ Local \ Android \ sdk \ build-tools \ 24.0.0-preview \ lib \ shrinkedAndroid.jar] 准备输出jar [G:\ Projects \ Shavanma \ app \ build \ intermediates \ multi-dex \ debug \ componentClasses.jar] 从程序jar [G:\ Projects \ Shavanma \ app \ build \ intermediates \ transforms \ jarMerging \ debug \ jars \ 1 \ 1f \ combined.jar]复制资源 :app:transformClassesWithMultidexlistForDebug FAILED 错误:任务':app:transformClassesWithMultidexlistForDebug'执行失败。
com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process' command' C:\ Program Files \ Java \ jdk1.7.0_79 \ bin \ java.exe''完成非零退出值1
答案 0 :(得分:0)
尝试在build.gradle文件中添加: 在依赖
compile 'com.android.support:multidex:1.0.0'
然后为您的应用创建一个全局应用程序类:
import android.support.multidex.MultiDex;
public class Global_class extends Application {
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
在应用程序标记
下的清单文件中添加此类 <application
android:name="com.package_name.Global_class"
</application>