2

I have simple app to read cells from Excel file (2007, .xlsx).

I am using https://github.com/andruhon/android5xlsx libraries.

I am getting this error when building: http://pastebin.com/80jHfEVT (it's too long)

You can download my project if you need from here: https://mega.nz/#!2xwwAAJA!vwr_I7iL_htvem_R5tuZYfcT21xhrg2z2zhMJLzmq8Y with password "stackoverflow" (without "").

Source is same like here: java.exe finished with non-zero exit value 1 (my question), but I am using this gradle now:

Gradle.build

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    dexOptions {
        preDexLibraries false
        //incremental true
        javaMaxHeapSize "4g"
    }

    afterEvaluate {
        tasks.matching {
            it.name.startsWith('dex')
        }.each { dx ->
            if (dx.additionalParameters == null) {
                dx.additionalParameters = ['--multi-dex']
            } else {
                dx.additionalParameters += '--multi-dex'
           }
        }
    }

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

    defaultConfig {
        applicationId "tona_kriz.kriziksupl"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"

        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    //project.tasks.withType(com.android.build.gradle.tasks.Dex) {
    //    additionalParameters=['--core-library'] // --core-library option needed for now, will fix it soon
    //}
}

dependencies {
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:multidex:1.0.1'
    compile files('libs/poi-3.12-android.jar')
    compile files('libs/poi-ooxml-schemas-3.12-20150511.jar')
}

Any solutions for me?

Community
  • 1
  • 1
antoninkriz
  • 966
  • 4
  • 18
  • 36

3 Answers3

1

Ok, I found it! I need to use core-library in gradle.build.

project.tasks.withType(com.android.build.gradle.tasks.Dex) {
        additionalParameters=['--core-library'] // --core-library option needed for now, will fix it soon
    }

(source: https://github.com/andruhon/android5xlsx/blob/master/build.gradle )

EDIT: Or use library with changed javax to something else (etc aavax)

antoninkriz
  • 966
  • 4
  • 18
  • 36
  • im getting this error when i sync gradle.. Error:(39, 0) Could not find property 'com' on com.android.build.gradle.AppExtension_Decorated@27245087 – Razel Soco Jan 26 '16 at 07:01
  • @RazelSoco Please make a new thread or try searching a little bit yourself – antoninkriz Jan 26 '16 at 21:36
0

Why didn't you try my solution ? That idea comes from the same error:

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1

And I solved my problem by the idea , this error caused by repeated referencing packages , just trust me , just try it : java.exe finished with non-zero exit value 1

Community
  • 1
  • 1
John
  • 134
  • 1
  • 5
  • Providing that libs is not solution, there are not system libs, just wrong written one. Using that libraries from that link should solve this, there was used "javax" -> "aavax" hack to solve problem with "system" libs. – antoninkriz Oct 20 '15 at 04:58
0

This is giving an compilation error :

Could not find property 'com' on com.android.build.gradle.AppExtension_Decorated@10348e79.

gradle for android is not compatible with that attribute any more. Have a look at the config in this repo https://github.com/andruhon/android5xlsx

sschale
  • 5,168
  • 3
  • 29
  • 36
Beatrice Lin
  • 1,456
  • 14
  • 17