Android Studio is installing old apk on device

雨燕双飞 提交于 2019-11-28 05:57:44

I had the same problem. After trying numerous methods that didn't work, I realized that I had accidentally changed an option in my "Run Configuration". Here's exactly what I did to fix the issue.

  1. Run --> Edit Configurations
  2. With your configuration selected on the left panel (mine says "app"), in the General tab on the right panel, there is a section called "Before launch". This section should have an option added called "Gradle-aware Make", but I had accidentally removed it.
  3. I re-added it by pressing the "+", then clicking OK in the popup (leave the input box in the popup blank).
  4. Click apply.

This fixed the problem immediately. Hope this helps someone!

Run / Debug Configurations / Miscellaneous TAB [] Uncheck: Skip installation if APK has not changed

Android Studio doesn't always detect small changes in code.

The behaviour is erratic. I solved it by reviewing my code.It turned out that there was a resource file that was invalid. Try reverting back to the last working version of your code before the current changes... Probably a known issue that will be/was resolved out of Beta

mir

Google thinks it is a feature, not a bug

https://code.google.com/p/android/issues/detail?id=156263

Their proposed solution is to copy the apk(s) instead of manipulating the filename, as in e.g.

Copying APK file in Android Gradle project

I was also facing this issue and get solution by deleting build folder manually because some time ide cannot be able to delete this. So go to the app folder and find build folder delete this and after clean and build project and run again. projectname->app->build

You should select "Deploy default APK" option in Run/Debug Configurations. After that Android Studio will upload and install new apk to your emulator/device when you run application.

In android studio. at right side. see gradle option. click it. and then press circular arrows button shown in red square.

I've spent way too many hours to keep this to myself. The way I fixed it was that I noticed some hours later that I was using different layout version in res/ .... I have actually two versions of layout (layout-v26) and (layout). All this time I was modifying the other one and uploading different one. Maybe its just a newbie mistake but I hope somebody will find it useful.

The reason why there are 2 version was because of " autofillHints="" -> quickfix -> create new version of layout "

image of my tree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!