title: Error code -7 when trying to install release APK
body: <p>I've taken all appropriate steps to create the release APK. (<a href="http://www.techotopia.com/index.php/Generating_a_Signed_Release_APK_File_in_Android_Studio">Demonstration of steps required</a>)</p>
  
  <p>My device (Nexus 7 2012) is set to allow installs from unknown sources.</p>
  
  <p>I emailed the APK (app-release.apk) to myself and attempted to open it from GMail, as this should work.</p>
  
  <p>EDIT: I apologize, I also should have included that I did uninstall the app from settings > apps > (app in question) > "uninstall" button.</p>
  
  <p>However, the app immediately fails to load, with only the following logcat info:</p>
  
  <pre><code>05-30 14:44:41.689      466-497/? W/PackageManager﹕ Package edu.osu.expandablelistviewtest1 signatures do not match the previously installed version; ignoring!
  05-30 14:44:41.914      466-497/? I/art﹕ Explicit concurrent mark sweep GC freed 74971(3MB) AllocSpace objects, 22(1348KB) LOS objects, 33% free, 28MB/43MB, paused 9.752ms total 220.463ms
  05-30 14:44:41.927  20704-20704/? D/InstallAppProgress﹕ Installation error code: -7
  05-30 14:44:43.094  20704-20704/? I/InstallAppProgress﹕ Finished installing edu.osu.expandablelistviewtest1
  </code></pre>
  
  <p>I've tried every search string I can think of and can't find any information on error -7's meaning. Looking at the <a href="https://android.googlesource.com/platform/packages/apps/PackageInstaller/+/47fe118e0178e9d72c98073ff588ee5cf353258e/src/com/android/packageinstaller/InstallAppProgress.java">code on GitHub</a>, we see the following code:</p>
  
  <pre><code>public void handleMessage(Message msg) {
    ...
    if (msg.arg1 == PackageManager.INSTALL_SUCCEEDED) {
      ...
    } else if (msg.arg1 == PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE){
      ...
     } else {
      // Generic error handling for all other error codes.
      centerTextDrawable.setLevel(1);
      centerExplanationLabel = getExplanationFromErrorCode(msg.arg1);
      centerTextLabel = R.string.install_failed;
      mLaunchButton.setVisibility(View.INVISIBLE);
    }
    ...
    private int getExplanationFromErrorCode(int errCode) {
      Log.d(TAG, "Installation error code: " + errCode);
      switch (errCode) {
      case PackageManager.INSTALL_FAILED_INVALID_APK:
        return R.string.install_failed_invalid_apk;
      case PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES:
        return R.string.install_failed_inconsistent_certificates;
      case PackageManager.INSTALL_FAILED_OLDER_SDK:
        return R.string.install_failed_older_sdk;
      case PackageManager.INSTALL_FAILED_CPU_ABI_INCOMPATIBLE:
        return R.string.install_failed_cpu_abi_incompatible;
      default:
        return -1;
      }
    }
    ...
  }
  </code></pre>
  
  <p>...so we have no way of knowing what the "-7" means. (Beyond that it is none of the switch cases.)</p>
  
  <p>I'm open to any ideas / suggestions. Thank you.</p>