com.android.jack.ir.ast.JReturnStatement at" Unknown source info"

时间:2016-10-28 14:09:19

标签: android gradle jgrapht

我试图在我的应用程序中导入Jgrapht库,但每次我尝试构建APK时,android studio都会向我显示:

错误:任务':app:transformClassesWithPreJackPackagedLibrariesForDebug'执行失败。

  

com.android.sched.scheduler.RunnerProcessException:' TypeLegalizer' runner on' private final synthetic int org.jgrapht.alg.vertexcover .- $ Lambda $ 25. $ m $ 0(java.lang.Object arg0)':访问期间出现意外错误:com.android.jack。 ir.ast.JReturnStatement at" Unknown source info"

问题是什么以及如何解决?请帮帮我!

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.0'


    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }

    defaultConfig {
        applicationId "it.univpm.gruppoids.iotforemergencyandnavigation"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        jackOptions {
            enabled true
        }
    }

    compileOptions {
        incremental true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    repositories {
        maven {
            url "https://mint.splunk.com/gradle/"
        }
    }

    packagingOptions {
        exclude 'META-INF/services/org.apache.sis.storage.DataStoreProvider'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/MANIFEST.MF'
    }

    /*buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.pro'
        }
    }*/
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:25.0.0'
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:percent:25.0.0'
    compile 'com.android.support:support-v4:25.0.0'
    compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
    compile 'com.google.zxing:core:3.2.1'
    compile files('lib/jgrapht-ext-1.0.0-uber.jar')
    compile files('lib/jgrapht-ext-1.0.0.jar')
    compile files('lib/jgrapht-demo-1.0.0.jar')
    compile files('lib/jgraph-5.13.0.0.jar')
    compile files('lib/antlr4-runtime-4.5.3.jar')
    compile files('lib/jgrapht-core-1.0.0.jar')
}

另一个朋友:

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

buildscript {
    repositories {
        mavenCentral()
        /*maven {
            url "https://plugins.gradle.org/m2/"
        }*/

        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        classpath 'me.tatarka:gradle-retrolambda:3.3.0'
    }
}
allprojects {
    repositories {
        jcenter()
        mavenCentral()
    }
}
apply plugin: 'me.tatarka.retrolambda'
task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:0)

我能想到的最简单的方法是使用maven,然后只需将依赖项添加到项目中。这样就可以为你自己设置JGraphT节省很多麻烦。

你可以在这里找到如何使用maven与android studio:How to import Maven dependency in Android Studio/IntelliJ?

虽然JGraphT的依赖关系在" Maven Releases"部分: http://jgrapht.org/