deano2390 / MaterialShowcaseView

A Material Design themed ShowcaseView for Android
Apache License 2.0
2.71k stars 526 forks source link

C:\Program Files\Java\jdk1.7.0_79\bin\java.exe finished with non-zero exit value 2 #38

Open marianpavel opened 9 years ago

marianpavel commented 9 years ago

As you can see from title I am receiving exit value 2 when trying to compile the project with library:

Error:Execution failed for task ':app:dexDebug'.

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 2

I have jitpack in repositories, as you can see:

apply plugin: 'com.android.application'

android { compileSdkVersion 22 buildToolsVersion '22.0.1'

defaultConfig {
    applicationId "com.example.marian.digimusicstream"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"

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

repositories { maven { url "https://jitpack.io" } }

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile('org.restlet.jse:org.restlet.ext.httpclient:2.1.2') { exclude group: 'org.restlet', module: 'jse' exclude group: 'org.restlet.ext', module: 'ss1' } android { packagingOptions { exclude 'META-INF/DEPENDENCIES.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/notice.txt' exclude 'META-INF/license.txt' exclude 'META-INF/dependencies.txt' exclude 'META-INF/ASL2.0' exclude 'META-INF/services/org.restlet.engine.ClientHelper' } } compile 'com.android.support:appcompat-v7:22.2.1' compile 'net.koofr:java-koofr:1.2.8' compile 'org.apache.httpcomponents:httpclient:4.3.5' compile 'org.restlet.jse:org.restlet.ext.jackson:2.1.2' compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.3' compile 'com.rengwuxian.materialedittext:library:1.8.3' compile 'com.github.navasmdc:MaterialDesign:1.5@aar' compile 'com.google.android.gms:play-services:7.0.0' compile 'com.android.support:recyclerview-v7:22.0.+' compile 'com.baoyz.pullrefreshlayout:library:1.0.1' compile('com.mikepenz:materialdrawer:3.1.2@aar') { transitive = true } compile 'com.wnafee:vector-compat:1.0.5' compile 'me.drakeet.materialdialog:library:1.2.2' // compile 'com.google.code.gson:gson:2.2.+' compile 'com.sothree.slidinguppanel:library:3.1.1' compile 'com.github.deano2390:MaterialShowcaseView:1.0.5@aar' }

deano2390 commented 9 years ago

This part is in the wrong build.gradle file:

repositories { maven { url "https://jitpack.io" } }

It should be in your application build.gradle NOT your module build.gradle

marianpavel commented 9 years ago

I have added them in build gradle but I still receive the error, enabling multidex works for me but I would like to not, any ideea for a fix ? / Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { repositories { jcenter() maven { url "https://jitpack.io" } } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' classpath 'com.novoda:bintray-release:0.2.7' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

allprojects { repositories { jcenter() maven { url "https://jitpack.io" } } }

MFlisar commented 9 years ago

If enabling mutlidex works, this means, the resulting apk has too many methods in it. Mostly this is due to google libraries, they are really large. Never include them as a whole, but only the parts you need like following for example:

compile 'com.android.support:support-v4:23.1.0'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'

Maybe some other heavy libraries may also cause such problems. If you really need them, try optimising the build with proguard. If all this does not help and you need all libraries and can't minimise them, you have to enable multidex...

marianpavel commented 9 years ago

I am using only the appcompat, I know the androidsupport libraries make some problems but I don't know any solution for this. I will see what can be done with proguard.

nitink133 commented 6 years ago

@marianpavel I have the same problem and I am just waste my 3days on it i tried all possible and available solution

This is my project gradle


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

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.google.gms:google-services:3.3.1'

        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
        maven { url "https://mint.splunk.com/gradle/" }
        maven { url "https://raw.githubusercontent.com/smilefam/SendBird-SDK-Android/master/" }
        google()
    }
}

and This is my application level build gradle

apply plugin: 'com.android.application'

android {
    signingConfigs {
        release {
            keyAlias 'XXXXXXXXX'
            keyPassword 'XXXXXXXXXXX'
            storeFile file('/media/XXXXX/Development/Android Studio Projects/XXXXXX/Data/Keystore/XXXXXXX.jks')
            storePassword 'XXXXXXX'
        }
    }

    compileSdkVersion 27
    defaultConfig {
        applicationId "XXXXXX"
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
        versionCode 7
        versionName "1.7"
        signingConfig signingConfigs.release
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true

    }
    aaptOptions {
        additionalParameters "--no-version-vectors"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
//        release {
//            debuggable true
//            minifyEnabled false
//            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
//            signingConfig signingConfigs.release
//        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/rxjava.properties'
    }

    dataBinding {
        enabled = true
    }

    buildTypes.each {
        it.buildConfigField 'String', 'CLIENT_ID', CLIENT_ID
        it.buildConfigField 'String', 'CLIENT_SECRETE', CLIENT_SECRETE
        it.buildConfigField 'String', 'SERVER_URL', BASE_URL
    }

    defaultConfig {
        // Enabling multidex support.
        multiDexEnabled true
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildToolsVersion '27.0.3'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')

    // android support libraries
    implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
    implementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion"
    implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion"
    implementation "com.android.support:design:$rootProject.supportLibraryVersion"
    implementation "com.android.support.constraint:constraint-layout:$rootProject.constraintLayoutVersion"

    // reactive
    implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxjava2Version"
    implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxandroidVersion"

    //Retrofit
    implementation "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"
    implementation "com.squareup.retrofit2:converter-jackson:$rootProject.retrofitVersion"
    implementation "com.jakewharton.retrofit:retrofit2-rxjava2-adapter:$rootProject.retrofitAdapterVersion"
    implementation "com.squareup.okhttp3:logging-interceptor:$rootProject.okHttp3Version"

    //Glide - Image Loading library
    implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion"
    annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.glideVersion"
    implementation "com.splunk.mint:mint:$rootProject.mintVersion"

    //
    implementation "de.hdodenhof:circleimageview:$rootProject.circleimageviewVersion"

    // Add Smooch core and ui
    implementation "io.smooch:core:$rootProject.smochVersion"
    implementation "io.smooch:ui:$rootProject.smochVersion"
    compile 'me.everything:providers-android:1.0.1'

    //Add SendBird
    implementation 'com.sendbird.sdk:sendbird-android-sdk:3.0.60'
    implementation 'org.jsoup:jsoup:1.11.2'
    implementation 'com.dinuscxj:circleprogressbar:1.1.1'
    implementation 'com.github.stfalcon:multiimageview:0.1'

    // Firebase
    implementation 'com.google.firebase:firebase-messaging:15.0.2'

    //    provided 'com.google.auto.value:auto-value:' + autoValueVersion

    //    annotationProcessor 'com.google.auto.value:auto-value:' + autoValueVersion
}

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

Thanks in advance for help