任务执行失败':app:transformClassesWithMultidexlistForPropDebug' - 应用程序编译但不运行

时间:2018-03-19 07:20:24

标签: android gradle android-gradle

这是完整的错误:

  

错误:任务':app:transformClassesWithMultidexlistForPrpDebug'执行失败。   com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:使用带有参数的主类com.android.multidex.ClassReferenceListBuilder执行java进程时出错{/ Users / user / Documents / Repositories /secret/secret/app/build/intermediates/multi-dex/prp/debug/componentClasses.jar / Users / user / Documents / Repositories / secret / secret / app / build / intermediates / transforms / jarMerging / prp / debug / jars /1/1f/combined.jar}

我已经为我的gradle版本添加了一个库(https://github.com/signalr4j/signalr4j)。由于该项目编译和构建,但一旦我按下运行,我收到该错误。请注意,图书馆已经实施并得到认可。

这是完整的gradle代码:

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

    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.0'
    }
}

apply plugin: 'org.greenrobot.greendao'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'newrelic'

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

greendao {
    schemaVersion 1
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"

    //
    // Setting the heap size the largest size possible.
    dexOptions {
        javaMaxHeapSize "4g"
        jumboMode true
    }
    defaultConfig {
        applicationId "secret.app.com"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 665
        versionName "1.7.0.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding {
        enabled = true
    }

    productFlavors {
        prp {
            buildConfigField 'String', 'ORGANIC_GATEWAY', '""'
        }

        production {
            buildConfigField 'String', 'ORGANIC_GATEWAY', '""'
        }

        myapp {
            buildConfigField 'String', 'ORGANIC_GATEWAY', '"X"'
        }

        mumayi {
            buildConfigField 'String', 'ORGANIC_GATEWAY', '"Y"'
        }

        zhushou_360 {
            buildConfigField 'String', 'ORGANIC_GATEWAY', '"J"'
        }

        zhushou_sogou {
            buildConfigField 'String', 'ORGANIC_GATEWAY', '"Z"'
        }

        directlink {
            buildConfigField 'String', 'ORGANIC_GATEWAY', '"A"'
        }

        letv {
            buildConfigField 'String', 'ORGANIC_GATEWAY', '"B"'
        }

        xiaomi {
            buildConfigField 'String', 'ORGANIC_GATEWAY', '"C"'
        }
    }

    applicationVariants.all { variant ->

        //
        // Application variable instantiation code
        if (variant.productFlavors[0].name == "prp") {
            buildConfigField 'boolean', 'isInDebugMode', 'true'
            buildConfigField 'boolean', 'shouldShowLoginShortcut', 'true'
        } else {

            buildConfigField 'boolean', 'isInDebugMode', 'false'
            buildConfigField 'boolean', 'shouldShowLoginShortcut', 'false'
        }

        //
        // Application naming code
        variant.outputs.each { output ->
            def project = "Secret"
            def separator = "_"
            def flavor = variant.productFlavors[0].name
            def version = variant.versionName
            def versionBuildNumber = variant.versionCode
            def buildName = variant.getBuildType().name

            if (flavor == "production" && buildName == "release") {
                flavor = "PlayStore"
            }

            def newApkName =
                    project +
                    separator +
                    version + "(" + versionBuildNumber + ")" +
                    separator +
                    flavor + "(" + buildName + ")" +
                    ".apk"

            output.outputFile = new File(output.outputFile.parent, newApkName)
        }
    }
}

ext.googleLibraryVersion = '25.4.0'
ext.firebaseAndPlayServicesLibraryVersion = '11.8.0'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true
    }

    compile 'com.android.support:multidex:1.0.1'

    compile "com.android.support:appcompat-v7:$googleLibraryVersion"
    compile "com.android.support:recyclerview-v7:$googleLibraryVersion"
    compile "com.android.support:support-v4:$googleLibraryVersion"
    compile "com.android.support:design:$googleLibraryVersion"
    compile "com.android.support:gridlayout-v7:$googleLibraryVersion"
    compile "com.android.support:support-annotations:$googleLibraryVersion"

    compile "com.google.firebase:firebase-core:$firebaseAndPlayServicesLibraryVersion"
    compile "com.google.firebase:firebase-messaging:$firebaseAndPlayServicesLibraryVersion"

    compile 'me.pushy:sdk:1.0.28'

    compile "com.google.android.gms:play-services-gcm:$firebaseAndPlayServicesLibraryVersion"
    compile "com.google.android.gms:play-services-analytics:$firebaseAndPlayServicesLibraryVersion"

    compile 'com.appsflyer:af-android-sdk:4.7.1'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.google.code.gson:gson:2.8.0'

    compile 'com.newrelic.agent.android:android-agent:5.13.0'

    compile 'org.greenrobot:greendao:3.2.2'

    compile 'at.wirecube:additive_animations:1.5.0'

    compile 'com.github.tsurkis:timdicator:1.1.0'

    compile 'com.github.signalr4j:signalr4j:2.0.1'
}

apply plugin: 'com.google.gms.google-services'

这是一般的gradle文件:

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

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath "com.newrelic.agent.android:agent-gradle-plugin:5.13.0"
        classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我浏览了半天的互联网,没有一个答案适合。图书馆有缺陷吗?

0 个答案:

没有答案