1

I use a technique almost identical to Change apk name with Gradle to change my APK filenames to include the current git hash. Android Studio is caching the APK filename (or doing something that results in the same behavior). This means the resulting APK filename is wrong after each commit unless I tell Android Studio to re-sync the gradle files. This is really only an annoyance for when I tell it run my current code on a connected device. It builds fine, but it always tries to install and run an older (or missing after a clean) APK.

Is there a way, other than remembering to re-sync the gradle files, that would fix this? I feel like this used to work fine in older Android Studio releases.

Community
  • 1
  • 1
Harvey
  • 5,703
  • 1
  • 32
  • 41
  • Isn't it bad practice to include APK files into VCS? – OneCricketeer Mar 29 '16 at 15:45
  • 1
    The apk isn't committed to vcs itself. Any action that changes the filename will require a gradle re-sync or it will run the old version (or fail if missing) from the IDE. I have a similar problem where the version code is in the filename. – Hugh Jeffner Mar 29 '16 at 16:33
  • It seems like the value is cached in `Library/Caches/AndroidStudio1.5/caches/names.dat.keystream` (location on OSX). – Harvey Mar 29 '16 at 17:30

0 Answers0