This is a very strange one. Today AS (1.4) stopped correctly re-creating the debug apk in my project:
- Any XML changes are not reflected in the code when running the project
- Changes to Java code are propagating, even when the XML changes are not
- Cleaning and then hitting run seems to fix it, an updated APK is successfully created every time.
- I have two build variants in my project, this problem only affects one of them.
- I am using Genymotion, but the problem exists on the regular emulator and hardware as well.
- I suspect there is some kind of lock being placed on the xml files. For example if I rename a file and hit run, the changes propagate. But inspecting the R.java shows entries for both the old file name and the new one - the old one is simply not being cleared / refreshed.
- The xml layout I'm testing this with has now been stripped back to a blank relative layout with a background color. The color is not being updated when it should be.
I don't really know much about the build process, so all I have tried is deleting the build folder, re-importing the project and the old restart / invalidate cache on Android Studio. Any suggestions as to what might cause this strange behavior or how to fix it?
Edit: It's very difficult to pin down the behavior behind this - sometimes I've noticed it consistently affecting only certain xml files. Looks like this guy has the same issue: Android Studio project build issue
I've spent a couple hours reinstalling Android Studio from scratch and the issue remains..