相关疑难解决方法(0)

错误:任务':app:dexDebug'的执行失败.com.android.ide.common.process.ProcessException

错误:任务':app:dexDebug'的执行失败.

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\ Program Files\Java\jdk1.8.0_40\bin\java.exe''以非完成零退出值2

我搜索了所有类似的问题和解决方案,但他们没有帮助.我希望像你这样的专家来.

项目代码已上传到bitbucket:https://tainule@bitbucket.org/tainule/numad-huizhang.git

我有两个模块,app和端点.以下是来自Module:app:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "edu.neu.madcourse.huizhang1"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 3
        versionName "2.1"
//        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }
}

dependencies {


    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.android.support:appcompat-v7:21.0.+"
    compile 'com.google.android.gms:play-services:+'
    compile 'com.google.guava:guava:18.0'
    compile 'com.google.code.gson:gson:1.7.2'
    compile 'org.apache.httpcomponents:httpmime:4.4-beta1'
    compile 'org.apache.httpcomponents:httpclient:4.4-beta1'
    compile 'org.apache.httpcomponents:httpcore:4.4-beta1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
    compile project(path: ':endpoint', configuration: 'android-endpoints')
    compile files('src/main/res/libs/KeyValueAPI.jar')

}
Run Code Online (Sandbox Code Playgroud)

以下是来自Module端点:

buildscript {
    repositories …
Run Code Online (Sandbox Code Playgroud)

java android gradle

71
推荐指数
8
解决办法
12万
查看次数

org.gradle.api.tasks.TaskExecutionException:任务':app:transformClassesWithDexForDebug'的执行失败

我是Android Studio的新手,我一直在使用eclipse,但由于65K我的项目中的错误,我需要将其迁移到Android Studio.在跑步的时候

./gradlew assembleDebug

我收到错误说: -

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 '/opt/jdk/jdk1.8.0_45/bin/java'' finished with non-zero exit value 1
Run Code Online (Sandbox Code Playgroud)

我知道这是将eclipse项目迁移到Android Studio时非常常见的错误.

并且相信我,我搜索了许多具有相同问题的链接,并尝试了他们在答案中提到的所有内容,但不是为我工作

这是我得到的链接: -

任务':app:transformClassesWithDexForDebug'的执行失败 - Gradle依赖?

在为Android实施Google登录时,任务':app:transformClassesWithDexForDebug'的执行失败

Android Studio TransformException:错误:任务':app:transformClassesWithDexForDebug'的执行失败

错误:任务':app:transformClassesWithDexForDebug'的执行失败

com.android.build.transform.api.TransformException

https://github.com/journeyapps/zxing-android-embedded/issues/110

还有很多

我尝试了每个解决方案,我尝试.jar在我的项目中逐个添加文件,我只使用那些在我的项目中使用的Google服务包,我甚至添加了multidexjar.But没有什么可以帮助我

这是我的Build.gradle文件: -

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.petzview.android"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles …
Run Code Online (Sandbox Code Playgroud)

java android android-studio

57
推荐指数
5
解决办法
18万
查看次数

:app:dexDebug ExecException以非零退出值2结束

任何人都可以帮我解决以下错误.当我清理项目时,它不会显示任何错误,但每次我尝试运行时都会收到此消息.

错误:任务':app:dexDebug'的执行失败.

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\ Program Files\Java\jdk1.8.0_45\bin\java.exe''以非完成零退出值2

应用程序运行没有错误,但随着我的系统崩溃并重新启动Android工作室我几乎没有Android API 22的更新.更新后,应用程序继续给我这个错误消息.我下载了JDK 8并尝试运行但没有工作.后来我在这个堆叠帖后降级到JDK 7,但仍然没有修复它. 是否可以使用Java 8进行Android开发?

我看过很多类似的问题,但没有一个适合我.在堆栈上发现的一些类似问题是

为什么java.exe在android studio中以值1退出

错误:任务':app:dexDebug'的执行失败.> comcommand以非零退出值2结束

Java以非零退出值2完成 - Android Gradle

java.exe以非零退出值2结束

进程'命令'C:\ Program Files\Java\jdk1.8.0_31\bin\java.exe''以非零退出值2结束

我已经查看了gradle中的依赖项,以查看是否存在任何冲突但未找到任何冲突.

我甚至试图将代码复制到一个新项目并运行它但仍然没有成功.任何遇到同样问题并解决它的人请帮助我.

java android gradle android-studio android-gradle-plugin

25
推荐指数
3
解决办法
6万
查看次数

Gradle构建错误,错误:任务执行失败':app:transformResourcesWithMergeJavaResForDebug'

我已经更新了Android工作室1.4版,也更新了gradle版本(1.4.0-beta3).

这是我的build.gradle文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        //classpath 'com.android.tools.build:gradle:1.2.3'
        classpath 'com.android.tools.build:gradle:1.4.0-beta3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        //ViewPagerIndicator
        maven { url "http://dl.bintray.com/populov/maven" }
        jcenter()
        maven { url 'http://devrepo.kakao.com:8088/nexus/content/groups/public/' }
    }
}
Run Code Online (Sandbox Code Playgroud)

这是构建结果.

资料:摇篮任务[:应用程序:generateDebugSources,:应用程序:generateDebugAndroidTestSources,:应用程序:assembleDebug]:应用程序:预生成UP-TO-DATE:应用:preDebugBuild UP-TO-DATE:应用程序:checkDebugManifest:应用:preReleaseBuild UP-TO-日期:应用:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE:应用:prepareComAndroidSupportCardviewV72221Library UP-TO-DATE:应用:prepareComAndroidSupportDesign2221Library UP-TO-DATE:应用:prepareComAndroidSupportGridlayoutV72221Library UP-TO-DATE:应用:preDebugAndroidTestBuild UP-TO-DATE:应用:prepareComAndroidSupportMultidex101Library最新消息:app:prepareComAndroidSupportPaletteV72221Library UP-TO-DATE:app:prepareComAndroidSupportRecyclerviewV72221Library UP-TO-DATE:app:prepareComAndroidSupportSupportV42221Library UP-TO-DATE:app:prepareComFacebookAndroidFacebookAndroidSdk410Library UP-TO-DATE:app:prepareComGithubLawloretienneQuickreturn001Library UP-TO-DATE:应用:prepareComGithubRey5137Material121Library …

android gradle android-studio build.gradle

22
推荐指数
4
解决办法
9万
查看次数

如何限制DEX内存使用

我试图设置DEX任务可以在基于gradle的Android项目中使用的最大内存,但找不到任何选项来执行此操作.

我的动机要做到这一点是因为dex有时需要我的电脑开始交换,并成为一些分钟(所以我宁愿看到任务失败,然后释放一些更多的资源,然后重试)完全没有反应这么多的内存

在我的gradle.propertiesI org.gradle.jvmargs="-Xmx300m"限制Gradle本身使用的内存,但当Gradle启动dx它总是使用-Xmx1024.

那么如何让Gradle限制dx使用的内存?

android gradle dex

5
推荐指数
1
解决办法
6690
查看次数

在构建项目时获得转换异常

我尝试运行我的应用程序时收到以下错误:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 3
Run Code Online (Sandbox Code Playgroud)

这是我的应用级别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'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId 'com.galleri5.android'
        multiDexEnabled true
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 9
        versionName "0.8.1"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
} …
Run Code Online (Sandbox Code Playgroud)

android android-build android-gradle-plugin

4
推荐指数
1
解决办法
5359
查看次数

运行我的应用程序时Android Studio出错

我正在努力研究android studio上的新应用程序,我曾经在e上工作

 UNEXPECTED TOP-LEVEL EXCEPTION:
  com.android.dex.DexIndexOverflowException: method ID not in [0,          
  0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:484)
at    com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:261)
   Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
 com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
Run Code Online (Sandbox Code Playgroud)

这个错误会是什么?

我已经将一些jar文件移动到了我的日食中.而我的build.gradle就是这样的

   apply plugin: 'com.android.application'
     android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
    applicationId "com.netvariant.heinz"
    minSdkVersion 14
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),     'proguard-rules.pro'
    }
}}dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'}
Run Code Online (Sandbox Code Playgroud)

java android

4
推荐指数
1
解决办法
3万
查看次数

:app:transformClassesWithMultidexlistForDebug 失败

我试过以下链接

http://developer.android.com/intl/es/tools/building/multidex.html

意外的顶级异常:com.android.dex.DexException:多个 dex 文件定义

com.android.build.transform.api.TransformException

':app:transformClassesWithDexForDebug'。> com.android.build.transform.api.TransformException:当我在我的工作室项目中添加 Facebook 最新 SDK 时

Android Studio TransformException:错误:任务':app:transformClassesWithDexForDebug'的执行失败

Java 以非零退出值 2 结束 - Android Gradle

com.android.build.transform.api.TransformException

我的gradle构建文件如下。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'

    defaultConfig {
        applicationId "appId"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        incremental true
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile files('libs/rt.jar')
    compile 'com.android.support:multidex:1.0.0' …
Run Code Online (Sandbox Code Playgroud)

java android build.gradle android-multidex

4
推荐指数
1
解决办法
3万
查看次数

DexIndexOverflowException使用Google Maps API

我想创建一个使用Google Maps API的应用程序,我开始使用一个简单的应用程序来打开谷歌地图活动.(我从SDK Manager下载google play服务).我认为这是一个非常基本的程序,但是当我尝试运行我的应用程序时出错.

这是我的程序的代码,以及Android Studio生成的错误.

错误:

错误:任务':app:transformClassesWithDexForDebug'的执行失败.> com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:com.android.dex.DexIndexOverflowException:方法ID不在[0,0xffff]中:65536

代码:

public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {     
private GoogleMap mMap;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}


/**
 * Manipulates the map once available.
 * This callback is triggered when the map is ready to be used.
 * This is where we can add …
Run Code Online (Sandbox Code Playgroud)

java android dictionary

3
推荐指数
1
解决办法
1546
查看次数