I have to press “Run” twice or clean project before “Run” on Android Studio

Update

it seems to be that the issue is fixed in newer android studio version, currently i am working on android studio 4.2.1 and it is working fine even with allowing the parallel run feature.

Old Answer

After a long search, I found that the issue is in something called instant run when you rerun your code, to solve this issue in the older android studio you have to disable instant run by going to:

File -> Settings -> Build,Execution,Deployment -> Instant Run

and then disable it.

For me I am using the android studio +4.0.0 version so I opened:

Run -> Edit configurations... -> disable check box (Allow parallel run)*

It may slow your build a little but it better than running the app more than one time.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)