Android support library increases APK size a lot

前端 未结 4 1090
隐瞒了意图╮
隐瞒了意图╮ 2020-12-30 02:46

I\'m using AppCompat support library in my Android project. AppCompat has plenty of drawables and resources which I don\'t use in my app. That unne

4条回答
  •  轮回少年
    2020-12-30 03:29

    Starting from version 24.2.0, the v4 Support Library has been split into several smaller modules.

    So, apart from using shrinkResources and proguardFiles, also make sure that you are using only the specific modules that your app needs. e.g.

    If your app only uses Compat utils like NotificationCompat, ContextCompat or ResourcesCompat etc., use only the compat module as:

    compile 'com.android.support:support-compat:24.2.0'
    

提交回复
热议问题