finished with non-zero exit value error - android

I've tried any solution suggested trying to solved the aapt.exe error.
every time I'm trying to add a new dependency to the build.gradle I get this error and after removing the dependency the error disappear.
I've tried chnging the compile SDK, changing the build tools version, invalidate/clear cache, activating compile independent modules in parallel.
The only dependencies registered are:
signingConfigs { compile fileTree(include: '*.jar', dir: 'libs')
compile project(':android-support-v7-appcompat')
compile files('libs/android-integration-3.2.1.jar')
compile files('libs/android-core-3.2.1.jar')
How can I handle it if I need to add another dependency to my project?
I'm working on android studio 1.4.1
compileSdkVersion 19
buildToolsVersion '22.0.1'

you should be adding your dependency libraries in build.gradle in (Module:app), if you are adding any library using Android studio GUI it will end up adding that library in this place or if you manually place a library in libs and add it to project as library it will still be added here.
Kindly check where and how are you adding your dependency
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:support-v4:23.1.0'
compile 'com.google.code.gson:gson:2.4'
compile files('libs/commons-io-2.4.jar')
}
in above code gson library is added compile 'com.google.code.gson:gson:2.4' is added using android studio GUI and
apache common io is added compile files('libs/commons-io-2.4.jar')
by placing it's library in libs directory in the Android project

Related

what is the reason to raise the error without using firebase in android

Error:
Process: com.xportsoft.epicsudoku, PID: 5380
java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions
Gradle file:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.google.android.gms:play-services:9.2.0'
}
defaultConfig {
.....
multiDexEnabled true
}
Don't use
compile 'com.google.android.gms:play-services:9.2.0'
dependency completely in your project. Use only specific library dependencies from google-play-services library that are required to your project. For example if you want use google places then use following line
compile 'com.google.android.gms:play-services-location:9.0.2'
Firebase is now part of the Google, so this problem was occurring in your project.
For more refer this Google Documentation

failed to resolve com.android.support:support-v4:23.2.1

I add this library to my gradle file:
compile 'com.commit451:PhotoView:1.2.5'
but every time I compile PhotoView library, I get this error:
Error:Could not find com.android.support:support-v4:23.2.1.
I downloaded the new "Android Support Library 23.2.1 from android SDK manager
but I still get the error. this is really annoying I need help.
my dependencies:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.parse:parseui-login-android:0.0.1'
compile 'com.parse:parseui-widget-android:0.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.parse:parse-android:1.13.0'
compile 'com.commit451:PhotoView:1.2.5'
}
same issue here - solved by updating "Local Maven repository for Support Libraries" to rev. 28 (i updated via Standalone SDK Manager)
and as mentioned before, every com.android.support:xxx dependency should have the same version.

gradle error while add sugar ORM 1.4 dependancy

after adding Sugar ORM dependency to gradle script app file
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.github.satyan:sugar:1.4'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:design:23.1.1'
}
Gradle complied my project, but once I tried to run it in a physical device (via Android studio) I got this error :
Error:Your app has more methods references than can fit in a single dex file.
See https://developer.android.com/tools/building/multidex.html
There are now errors If I tried to compile and run the app with Sugar ORM 1.3
Has the library grown so large in version 1.4 it will no longer fit into a single DEX ?
Try to enable multiDex support by using:
defaultConfig {
multiDexEnabled true
}
in your build.gradle (app)
Hope this help!

Compiling com.parse:parsefacebookutils leads to com.parse.Parse Class not found exception

I'm currently trying to add Facebooklogin capabilites to my App.
According to the Android Docs, when I add
compile 'com.parse:parsefacebookutils-v4-android:1.10.3#aar'
To my Build.gradle it should include the entire com.parse.Parse, com.parse.ParseObject... classes already. So I removed the compile for the normale parse-android and now my dependencies look like that:
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.google.android.gms:play-services-auth:8.3.0'
compile 'com.parse:parsefacebookutils-v4-android:1.10.3#aar'
//compile 'com.parse:parse-android:1.10.3' //Already include in parsefacebookutils
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
//NOTE: I do not actually have anything in my 'libs' folder.
BUT after doing so my Applicationclass (and every other Class) can't find the com.parse.Parse stuff. And the com.parse namespace only contains the 'ParseFacebookUtils' class.
I already tried:
compiling the 'com.parse:parse-android:1.10.3' in the dependencies, which only leads to the expected 'DexError' when deploying.
Removing the #aar at the end, which imported the com.parse namespace correctly, but lead to the Gradle error. I assume because the facebookutils have the parse-android:1.10.3 as dependency in their maven project. (http://mvnrepository.com/artifact/com.parse/parsefacebookutils-v4-android/1.10.3)
Warning:Module 'com.parse:parsefacebookutils-v4-android:1.10.3' depends on one or more Android Libraries but is a jar
sounds like there is a bug in the parsefacebookutils that is loaded. I can't say what it is but work around is that download the latest jar files and use them instead of loading.
Parse-1.11.0
ParseFacebookUtilsV4-1.10.3
those .jar files in library directory and remove the compile rows from build.gradle.
at least I'm getting forward with this.

Android studio multi dex error while executing packageAllDebugClassesForMultiDex task

I am implementing multi dex for my project. I am able to compile the code afer implementing multidex but while running the project i am getting below mentioned error while executing packageAllDebugClassesForMultiDex task.
Error:Execution failed for task ':appname:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException: duplicate entry: android/support/multidex/MultiDex.class
dependencies list : -
dependencies {
compile project(':slidingMenu')
compile project(':androidPullToRefresh')
compile project(':googlePlayServices')
compile project(':caldroid')
compile files('libs/admsAppLibrary.jar')
compile files('libs/gson-2.3.1.jar')
compile files('libs/jackson-annotations-2.1.1.jar')
compile files('libs/jackson-core-2.1.1.jar')
compile files('libs/jackson-databind-2.1.1.jar')
compile files('libs/jsr305-1.3.9.jar')
compile files('libs/okhttp-2.2.0.jar')
compile files('libs/retrofit-1.9.0.jar')
compile files('libs/xtify-android-sdk-2.4.jar')
compile project(':clusterkraf')
compile files('libs/okio-1.0.0.jar')
compile files('libs/android-support-multidex.jar')
}
Below is my project structure.
library A contains my application class. In which i have implemented multidex.
Library B and library C depends on library A
My launch project D depends on library B and Library C. Library D android menifest i have defined the application class which is available in library A.
If you want to add play service library in build.gradle add compile 'com.google.android.gms:play-services:7.5.0' in dependences
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.5.0'
}
if there are conflict add
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
.....
dexOptions {
preDexLibraries = false
}
.....
}
in the android block

Categories

Resources