1

I try to use vector drawables in my project. Although i use multidex and related options , it cannot build project properly and gives "finished with non-zero exit value 2" error. I look for this error in every topic but any solution useful for me. This is my build.gradle snippet :

apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "droxoft.armin.com.shappy"
    multiDexEnabled true
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    generatedDensities = []
}
aaptOptions{
    additionalParameters "--no--version--vectors"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:support-vector-drawable:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-location:7.5.0'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.felipecsl.quickreturn:library:1.5.1'
compile 'com.android.support:multidex:1.0.1'
}

How can I overcome it ?? I just want to use vector drawables.

Gradle console:

     Configuration on demand is an incubating feature.
     :app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2320Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72320Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72320Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2320Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72320Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42320Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2320Library UP-TO-DATE
:app:prepareComAstuetzPagerslidingtabstrip101Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk4101Library UP-TO-DATE
:app:prepareComFelipecslQuickreturnLibrary151Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
AAPT err(Facade for 2113227392): C:\Users\BadLer\yeniworkspace\Shappy\app\src\main\res\drawable\ballon_progress.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited

:app:processDebugManifest UP-TO-DATE
:app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Bad\Programlama\AndroidStudioSDK\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 18.272 secs
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
CaveMan
  • 163
  • 11
  • Did you import the vector variables properly from an SVG or created them in Android studio? You can't just drag and drop them in the drawables folder. You need to right-click on the `drawables` and select **new->vector asset** and then choose the SVG you want to import, and then they'll work. – Vucko Apr 03 '16 at 11:54
  • Actually i just use toolbar and it gives this error – CaveMan Apr 03 '16 at 19:38
  • Possible duplicate of [libpng warning: iCCP: known incorrect sRGB profile](http://stackoverflow.com/questions/22745076/libpng-warning-iccp-known-incorrect-srgb-profile) – OneCricketeer Apr 03 '16 at 19:57
  • The error that you are overlooking is where is says "AAPT err" , basically, your `ballon_progress.png` needs fixed – OneCricketeer Apr 03 '16 at 19:58
  • Thank you @cricket_007 you save my night ! – CaveMan Apr 03 '16 at 19:59
  • Welcome. If you could delete your other question I commented on and provide the process for fixing your error as an answer below for yourself that will help others with similar issues. I have been thinking about making a general post about how to debug Gradle errors unless I can find one. – OneCricketeer Apr 03 '16 at 20:04

0 Answers0