Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why AssetManager creation takes tooo long to load that make application start slow

I am making an android app. When I compile and run it (even when I copy and paste apk on device and run) it takes too long to start and show me my first activity. I debugged logs and found that 1st log as follow takes like 20 seconds then from there after approx 20 seconds I get later logs and app runs.

First log of app:

5-19 18:41:42.816 29232-29232/com.softinator.mantrafm D/ResourcesManager: creating new AssetManager and set to /data/app/com.softinator.mantrafm-2/base.apk
like image 967
Rajendra Verma Avatar asked Nov 09 '22 14:11

Rajendra Verma


1 Answers

I was also facing the same problem. Thanks to one of my teammate, basically you'll have to disable "Instant Run" if you are using gradle 2.x

I installed android studio v2 and suddenly this problem came up. So basically before giving apk may it be debug apk or production apk, go to Settings -> Build, Execution, Deployment -> Instant Run and uncheck "Enable Instant Run to hot swap/resource changes on deploy". You need to disable that and then build apk and give it to somebody else or use yourself.

Regards,

Suyash

like image 192
Suyash Dixit Avatar answered Nov 14 '22 21:11

Suyash Dixit