Apk size increased drawable-xxxhdpi-v4

Viewed 660

I am unable to figure this out. My apk size has increased by at least another MB since the last release. Yes, I have added some new code and couple of vector assets thats it. But there is this drawable-xxxhdpi-v4 which got added to my apk and my png images are repeated there. Take a look.

Summary

As you can see, old apk has 0 bytes for this folder and the new apk has my png assets copied there.

Has anybody faced this? I just cant seem to figure out why is this hapenning. Its not even like these are new images. The old ones which were 0 bytes in this folder are now occupying space.

Gradle version 2.14.1 Plugin version 2.2.3

App build.gradle:

defaultConfig {
    applicationId project.APPLICATION_ID
    minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK_VERSION)
    targetSdkVersion Integer.parseInt(project.ANDROID_TARGET_SDK_VERSION)

    versionCode Integer.parseInt(project.VERSION_CODE)
    versionName project.VERSION_NAME

    multiDexEnabled true
    vectorDrawables.useSupportLibrary = true


    resConfigs "en", "fr"

    javaCompileOptions {
        annotationProcessorOptions {
            includeCompileClasspath true
        }
    }
}

lintOptions {
    abortOnError false
    disable 'MissingTranslation'
}

dataBinding {
    enabled = true
}
dexOptions {
    preDexLibraries = false
}

// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
    noCompress "db"

}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}

buildTypes {
    def BOOLEAN = "boolean"
    def TRUE = "true"
    def FALSE = "false"
    def LOGGING = "LOGGING"
    def STRICT_MODE = "STRICT_MODE"
    def DEBUG_MODE = "DEBUG_MODE"

    release {
        minifyEnabled true
        proguardFiles 'proguard-rules.txt', 'proguard-here-sdk.txt'
        // Resource shrinking confis
        shrinkResources true // remove unused resources
        signingConfig signingConfigs.release
        debuggable false
        buildConfigField BOOLEAN, LOGGING, FALSE
        buildConfigField BOOLEAN, STRICT_MODE, FALSE
        buildConfigField BOOLEAN, DEBUG_MODE, FALSE
        zipAlignEnabled true

        applicationVariants.all { variant ->
            if (variant.buildType.name == 'release') {
                variant.mergeAssets.doLast {
                    delete(fileTree(dir: variant.mergeAssets.outputDir, includes: ['ic_launcher_debug*']))
                }
            }
        }
    }
lintOptions {
    disable 'InvalidPackage'
}

packagingOptions {
    exclude 'META-INF/services/javax.annotation.processing.Processor'
}
2 Answers

The below config worked for me

defaultConfig {
    vectorDrawables.useSupportLibrary = true
  }
Related