android-studiobuildingnexus-4

Android Studio is installing old apk on device


I am developing an Android app using Android Studio (0.89 Build #AI-135.1404660, Built on Sept 3,2014) using both emulator and Nexus 4 device.

I had the same issue with a version prior to that.

The problem is that after I changed my code and resource files, I still get the old apk installed on the device or emulator.

What do I need to do to get it to run current code? Is it a building config?

Is it a known issue with Android Studio?

Or with a Nexus 4 device?

This is the second time it has happened, and I resolved it(then) after trying one of the steps below. They have not worked for me again.

Here is what I've tried

  1. Build > Clean Project > Restart Android Studio > Run
  2. Build > Rebuild Project > Run
  3. Step 1 plus Uninstalling of apk on device
  4. Step 2 plus Unistalling of apk on device
  5. Adding erroneous resource entry then running.

I have read the following:

  1. Android apk install: How to clear files from old version?
  2. adb - How to reinstall an app, without retaining the data?
  3. Device still has the old apk
  4. Android build doesn't update code base or resources for target .apk on device

None has worked so far.


Solution

  • 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