title: Android device uses resources from different density sets in debug and signed APK
body: <p>I noticed that my app shows slightly different layout on the same device depending on whether I am running the debug APK or the signed release APK. After much head scratching, I have isolated the problem to device density specific resource values. The device uses dimensions from v<em>alues-xxhdpi/dimens.xml</em> when I run the app in debug mode, and it uses dimensions from <em>values-xxxhdpi/dimens.xml</em> when I run the signed APK. The device in question is Samsung Galaxy S7 running Android 7.0</p>
  
  <p>Just to confirm this, I created a new empty project with just a hello world string in it. I defined different values for the string in <em>values/strings.xml</em>, <em>values-xxhdpi/strings.xml</em> and <em>values-xxxhdpi/strings.xml</em>. Here are the results.</p>
  
  <ul>
  <li>Debug apk shows xxhdpi string. Works as expected.</li>
  <li>Running the release apk from android studio (by specifying a signing config in the gradle file) shows xxhdpi string. Works as expected.</li>
  <li>Generate a signed apk by selecting Build | Generate Signed APK and run it. This time the app shows xxxhdpi string. Why ?!</li>
  </ul>
  
  <p>Why is this happening? Why is android selecting xxhdpi resources in debug mode and xxxhdpi resources in a signed APK?</p>