:app:dexDebug'. com.android.ide.common.process.ProcessException - android

I am developing an Android application and getting this error.
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 2
I searched for this on google and come to know that this error comes if I exceeded the dex limit imposed by Android. I tried different suggested solutions
like
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
and
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
But this cause other problems in my application. I am not using too much libraries in Gradle file but I don't know why this error coming.
Here is my Gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "ifisol.pinocal"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven { url "https://repo.commonsware.com.s3.amazonaws.com" }
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'at.blogc:expandabletextview:1.0.1#aar'
compile project(':tedpicker')
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.hedgehog.ratingbar:app:1.1.2'
compile 'com.leavjenn.smoothdaterangepicker:library:0.2.0'
compile files('libs/gson-2.4.jar')
compile files('libs/picasso-2.5.2.jar')
compile 'com.google.android.gms:play-services:8.3.0'
}
I need to have a some solid solution to this problem because this problem has already wasted my one whole day. I will be very thankful for any kind of help.

Related

Google maps android app build error :app:transformClassesWithDexForDebug

I am currently developing a custom themed version of google maps, and have spent the past god knows how long trying to resolve this build error. I have researched this extensively, and found nothing which seems to help solve my problem.
I have included my app/build.gradle file below
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.wtwelectronics.googlemapsrev2"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
incremental true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.android.gms:play-services:10.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}
The 1st error line of the gradle console output is below:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
I am using android studio 2.3.1, with latest SDK packages etc.
Thanks in advance.
try adding this in your gradle
compile 'com.google.android.gms:play-services-maps:10.2.0'
and look at this example for more.

Why Gradle gives this error? [duplicate]

This question already has answers here:
Out of memory issue after updating buildToolsVersion '23.0.1' in Android studio
(7 answers)
Closed 6 years ago.
I am building an app where I am using Location Fused Provider and Firebase cloud messaging. When I were using just Firebase cloud messaging everything was okay, but when I added Fused Locations and wanted to build app, console gives me this error:
Error:Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:1 error; aborting
:presentation:transformClassesWithDexForDebug FAILED
Error:Execution failed for task ':presentation:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: `com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 1`
This is my gradle:
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileOptions.incremental = false
defaultConfig {
applicationId "com.telnet.asp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
apt 'com.google.dagger:dagger-compiler:2.2'
provided 'javax.annotation:jsr250-api:1.0'
compile project(path: ':domain')
compile project(path: ':data')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.0-rc2'
compile 'com.android.support:design:23.4.0'
compile 'javax.inject:javax.inject:1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.google.dagger:dagger:2.2'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'net.danlew:android.joda:2.9.4.1'
compile 'com.android.support:percent:23.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
Does anyone know how to fix this? Please help.
Try add
dexOptions {
javaMaxHeapSize "4g"
}
You need to add dexOptions to your build.gradle:
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
// ...
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g" // 2g should be also OK
}
}
Your application is trying to allocate a larger amount of memory and is going OutOfMemory because it fails to.
Make sure to increase the javaMaxHeapSize with
android {
//...
dexOptions {
incremental = true;
javaMaxHeapSize "4g" // tweak the value here if you need/want
}
// ...
}
Also, check this google link regarding this error by checking their stack trace

Android studio - build failed '/home/node/Android/Sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1

Suddenly I could not build my projects with Android Studio by this following error. I have attached build.gradle file and SDK installation images, I have tried several hours but I could not get solved. Please help me to solve this problem.
Error:
Error:Execution failed for task ':qApp:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/node/Android/Sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1
build.gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.+'
}
}
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.qapp"
minSdkVersion 14
targetSdkVersion 21
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':facebookSDK')
compile project(':payPalDemo1')
compile project(':uberLibrary')
compile project(':bSLibrary')
compile project(':pullToRefresh')
compile project(':androidmapsutils')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:multidex:1.0.0'
compile files('libs/android-async-http-1.4.6.jar')
compile files('libs/cardio.jar')
compile files('libs/UserFormValidation.jar')
}
SDK list
Try to add this inside you gradle file:
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 23
.....
dexOptions {
javaMaxHeapSize "4g"
}
}
Try to add this lines in your dependencies:
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
And in the defaultConfig, use the same targetSdkVersion of the compileSdkVersion

Android Studio: Execution fails when I add SignalR client library

I have downloaded signalr client library from https://github.com/SignalR/java-client. On build it generated jar files.
When I add the jar files to my project, the project builds but when I try to run I get the error message below:
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.8.0_25\bin\java.exe'' finished with non-zero exit value 1
Previously I followed the tutorial on https://whathecode.wordpress.com/2014/03/20/getting-started-with-the-java-signalr-sdk/ and downloaded jar files from https://www.mediafire.com/?8qun6hbs3onnbbl. Those jar files were working fine.
However I needed the WebSocket transport protocol which were implemented in the latest version.
I am not sure if removal of previous jar files causing any issues.
Gradle scripts:
signalr-client-sdk
apply plugin: 'java'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.2.2'
compile 'org.java-websocket:java-websocket:1.3.1'
}
-signalr-client-sdk-android
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':signalr-client-sdk')
}
-My project
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
applicationId "com.eb5.uvexa.uvexadriver"
minSdkVersion 17
targetSdkVersion 21
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions
{
preDexLibraries=false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile files('libs/gson-2.2.2.jar')
compile files('libs/mail.jar')
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/signalr-client-sdk.jar')
compile files('libs/signalr-client-sdk-android.jar')
}
I tried clean and rebuild, restarted the pc and also Invalidate option in Android Studio.
I am using windows10 and Android Studio(64). What am I doing wrong?

gradle returns error wen i use android-donations-lib

Im trying to add the lib Donations from android-donations-lib
and my app's gradle looks like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
// buildToolsVersion '21.1.2'
buildToolsVersion '20.0.0'
defaultConfig {
applicationId "com.listoapp.listo"
minSdkVersion 14
// minSdkVersion 18
// targetSdkVersion 18
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
productFlavors {
google {
buildConfigField "boolean", "DONATIONS_GOOGLE", "true"
}
fdroid {
buildConfigField "boolean", "DONATIONS_GOOGLE", "true"
}
}
}
repositories { mavenCentral() }
dependencies {
// compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile fileTree(include: 'Parse-*.jar', dir: 'libs')
compile 'com.android.support:support-v4:21.0.+'
compile 'com.github.clans:fab:1.3.0'
//with menus --Doron
compile 'com.afollestad:material-dialogs:0.7.2.0'
//Dialogs --Doron
compile 'com.github.rey5137:material:1.1.0'
//for new design
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.melnykov:floatingactionbutton:1.3.0'
//for add participant
compile 'com.github.medyo:fancybuttons:1.2#aar' //for fb login button
compile project(':facebook')
compile files('libs/ParseFacebookUtilsV4-1.9.0.jar')
compile 'com.github.amlcurran.showcaseview:library:5.0.0'
compile project(':libraries:Donations')
}
However, every time i try to run the app it gives me the error:
Error:Execution failed for task ':app:dexFdroidDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' finished with non-zero exit value 2
Does anyone have a clue on what this error is?
UPDATE:
I found the problam...i had to temove all traces of my previous billing system...thanks anyway :)

Categories

Resources