I was developing a map based app and used a library named AMap.jar to initialize map. The library contains a file named
First make your sure code is bug-free.
Second, observer behavior like as you said when your app runs successfully it should be keep on running without any problem until next build or till you go out of your app, if not then it means there is a problem in your code.
If your app keep on running without any problem util restart or till next build it mean you are suffering from instant-run bug and they are like
no changes to deploymean changes in code has not added to your app
Update to latest Build because this tends to happen more in older releases.
Disable instant run under your project settings.
Try to use the latest studio release which has totally improved instant-run .