尝试运行应用程序时Gradle失败

时间:2016-12-07 17:32:55

标签: android gradle android-gradle

我尝试用android studio测试我的应用程序,但是当我尝试运行我的应用程序时出现此错误。

:app:dexDebug
    AGPBI: {"kind":"SIMPLE","text":"trouble processing \"javax/transaction/HeuristicCommitException.class\":","position":{},"original":"trouble processing \"javax/transaction/HeuristicCommitException.class\":"}
    AGPBI: {"kind":"SIMPLE","text":"Ill-advised or mistaken usage of a core class (java.* or javax.*)","position":{},"original":"Ill-advised or mistaken usage of a core class (java.* or javax.*)"}
    AGPBI: {"kind":"SIMPLE","text":"when not building a core library.","position":{},"original":"when not building a core library."}
    AGPBI: {"kind":"SIMPLE","text":"This is often due to inadvertently including a core library file","position":{},"original":"This is often due to inadvertently including a core library file"}
    AGPBI: {"kind":"SIMPLE","text":"in your application\u0027s project, when using an IDE (such as","position":{},"original":"in your application\u0027s project, when using an IDE (such as"}
    AGPBI: {"kind":"SIMPLE","text":"Eclipse). If you are sure you\u0027re not intentionally defining a","position":{},"original":"Eclipse). If you are sure you\u0027re not intentionally defining a"}
    AGPBI: {"kind":"SIMPLE","text":"core class, then this is the most likely explanation of what\u0027s","position":{},"original":"core class, then this is the most likely explanation of what\u0027s"}
    AGPBI: {"kind":"SIMPLE","text":"going on.","position":{},"original":"going on."}
    AGPBI: {"kind":"SIMPLE","text":"However, you might actually be trying to define a class in a core","position":{},"original":"However, you might actually be trying to define a class in a core"}
    AGPBI: {"kind":"SIMPLE","text":"namespace, the source of which you may have taken, for example,","position":{},"original":"namespace, the source of which you may have taken, for example,"}
    AGPBI: {"kind":"SIMPLE","text":"from a non-Android virtual machine project. This will most","position":{},"original":"from a non-Android virtual machine project. This will most"}
    AGPBI: {"kind":"SIMPLE","text":"assuredly not work. At a minimum, it jeopardizes the","position":{},"original":"assuredly not work. At a minimum, it jeopardizes the"}
    AGPBI: {"kind":"SIMPLE","text":"compatibility of your app with future versions of the platform.","position":{},"original":"compatibility of your app with future versions of the platform."}
    AGPBI: {"kind":"SIMPLE","text":"It is also often of questionable legality.","position":{},"original":"It is also often of questionable legality."}
    AGPBI: {"kind":"SIMPLE","text":"If you really intend to build a core library -- which is only","position":{},"original":"If you really intend to build a core library -- which is only"}
    AGPBI: {"kind":"SIMPLE","text":"appropriate as part of creating a full virtual machine","position":{},"original":"appropriate as part of creating a full virtual machine"}
    AGPBI: {"kind":"SIMPLE","text":"distribution, as opposed to compiling an application -- then use","position":{},"original":"distribution, as opposed to compiling an application -- then use"}
    AGPBI: {"kind":"SIMPLE","text":"the \"--core-library\" option to suppress this error message.","position":{},"original":"the \"--core-library\" option to suppress this error message."}
    AGPBI: {"kind":"SIMPLE","text":"If you go ahead and use \"--core-library\" but are in fact","position":{},"original":"If you go ahead and use \"--core-library\" but are in fact"}
    AGPBI: {"kind":"SIMPLE","text":"building an application, then be forewarned that your application","position":{},"original":"building an application, then be forewarned that your application"}
    AGPBI: {"kind":"SIMPLE","text":"will still fail to build or run, at some point. Please be","position":{},"original":"will still fail to build or run, at some point. Please be"}
    AGPBI: {"kind":"SIMPLE","text":"prepared for angry customers who find, for example, that your","position":{},"original":"prepared for angry customers who find, for example, that your"}
    AGPBI: {"kind":"SIMPLE","text":"application ceases to function once they upgrade their operating","position":{},"original":"application ceases to function once they upgrade their operating"}
    AGPBI: {"kind":"SIMPLE","text":"system. You will be to blame for this problem.","position":{},"original":"system. You will be to blame for this problem."}
    AGPBI: {"kind":"SIMPLE","text":"If you are legitimately using some code that happens to be in a","position":{},"original":"If you are legitimately using some code that happens to be in a"}
    AGPBI: {"kind":"SIMPLE","text":"core package, then the easiest safe alternative you have is to","position":{},"original":"core package, then the easiest safe alternative you have is to"}
    AGPBI: {"kind":"SIMPLE","text":"repackage that code. That is, move the classes in question into","position":{},"original":"repackage that code. That is, move the classes in question into"}
    AGPBI: {"kind":"SIMPLE","text":"your own package namespace. This means that they will never be in","position":{},"original":"your own package namespace. This means that they will never be in"}
    AGPBI: {"kind":"SIMPLE","text":"conflict with core system classes. JarJar is a tool that may help","position":{},"original":"conflict with core system classes. JarJar is a tool that may help"}
    AGPBI: {"kind":"SIMPLE","text":"you in this endeavor. If you find that you cannot do this, then","position":{},"original":"you in this endeavor. If you find that you cannot do this, then"}
    AGPBI: {"kind":"SIMPLE","text":"that is an indication that the path you are on will ultimately","position":{},"original":"that is an indication that the path you are on will ultimately"}
    AGPBI: {"kind":"SIMPLE","text":"lead to pain, suffering, grief, and lamentation.","position":{},"original":"lead to pain, suffering, grief, and lamentation."}
    AGPBI: {"kind":"SIMPLE","text":"1 error; aborting","position":{},"original":"1 error; aborting"}


     FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:dexDebug'.
    > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 1

这是我的gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    dexOptions {
        incremental = true;
        preDexLibraries = false
        javaMaxHeapSize "6g" // 2g should be also OK
    }
    defaultConfig {
        applicationId "com.oscarhmg.indoorpositioningsystem"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

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

    defaultConfig {
        // Enabling multidex support.
        multiDexEnabled true
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile ('com.google.android.gms:play-services:8.1.0'){
        exclude group: 'com.google.common.annotations'
    }
    compile(project(path: ':end-backend', configuration: 'android-endpoints')){
        exclude(module: 'guava-jdk5')
    }
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5'
    //compile group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '0.4.0'
    compile ('com.google.cloud:google-cloud-pubsub:0.4.0')/*{
        exclude group: 'com.google.cloud',module:'protobuf';
        */exclude module: 'common'
    }
    configurations {
        all*.exclude group: 'org.apache.httpcomponents',module: 'httpclient'
        all*.exclude module: 'protobuf-java'
        all*.exclude group: 'com.google.common', module:'annotations'
    }

这是一个带有端点后端的应用程序,我尝试测试我的代码,但我不知道如何修复此错误。

0 个答案:

没有答案