Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove some density drawable from android library

Tags:

android

gradle

My app import admob:

com.google.android.gms:play-services-ads:8.4.0

But it make my app very big, I found there are "drawable-xxxhdpi", "drawable-tvdpi" from this library with very large images, I want to delete(exclude) those from this library.

I used "resConfigs" in gradle to just include the density folders I needed before,

but not sure since when the "resConfigs" for density is not supported,

https://code.google.com/p/android/issues/detail?id=179136

The apk split in density seems not fit my requirements.

what should I do now?

like image 731
virsir Avatar asked Feb 29 '16 13:02

virsir


1 Answers

You can try splitting and exluding the xxxhdpi and tvdpi from the releases apks.

  splits { 
        density { 
                 enable true  
                 exclude "xxxhdpi", "tvdpi",
        }
   }

This will generate differents apks in order to submit later to the playstore. For more information about splits here.

like image 151
JpCrow Avatar answered Nov 17 '22 09:11

JpCrow