Android Studio: Difference in size between Build APK vs Run APK

后端 未结 4 1838
我寻月下人不归
我寻月下人不归 2021-01-11 23:27

I have noticed a difference in size between the apk generated with these 2 options.

why is this happening ?

With the Build -> Build APK opti

4条回答
  •  时光说笑
    2021-01-12 00:05

    This would probably be better answered if posed as an issue to the Android Studio team. My guess is that you're using Instant Run inside Android Studio (AS). This would explain the larger size since Instant Run generates proxy classes for changed code.

    Edit the Run configuration to build using gradle build and you should be able to remove the extra code... But this WILL come with a much larger build/deploy time... If size of a debug build is really important to you then OK but for most this will ruin all the improvements the Android team has made to the DSL recently to improve speed

提交回复
热议问题