title: Error on installing apk - parsing the package
body: <p>I am working on an android app and everything works fine when I build it in my local system and run on emulator, but as soon as I make and release and install apk on my phone, it crashes with error -</p>
  
  <pre><code>There was an error parsing the package
  </code></pre>
  
  <p>As you can see, I am building with latest SDK and build tools, and my phone is running the same version on API too. I have <code>Untrusted Sources</code> installation allowed too.</p>
  
  <p>I am taking help of "Build a release version" section on <a href="http://developer.android.com/tools/building/building-studio.html">this</a> link. It is generating a file like - <code>app-release-unsigned.apk</code> in my <code>app/build/outputs/apk</code> folder. Please help with it.</p>
  
  <p><strong>Emulator AVD</strong> - </p>
  
  <pre><code>Galaxy Nexus, 1 GB RAM, API 22 (Android 5.1.1), CPU x86
  </code></pre>
  
  <p><strong>My Phone</strong> - </p>
  
  <pre><code>Nexus 5, 2 GB RAM, Android 5.1.1
  </code></pre>
  
  <p><strong>build.gradle</strong> -</p>
  
  <pre><code>apply plugin: 'android'
  apply plugin: 'com.android.application'
  
  repositories {
      mavenCentral()
      flatDir {
          dirs 'libs'
      }
  }
  
  android {
      compileSdkVersion 22 // api version
      buildToolsVersion "22.0.1" // build tools version
  
      defaultConfig {
          applicationId "org.compani.proj"
          minSdkVersion 8
          targetSdkVersion 22 // same as compilesdkversion
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      dependencies {
          //compile project(':android-beacon-library')
          compile 'org.altbeacon:android-beacon-library:2+@aar'
      }
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:22.0.0'
      compile 'com.android.support:recyclerview-v7:21.+'
      compile 'com.android.support:cardview-v7:21.+'
      compile 'com.android.support:support-v4:+'
  }
  </code></pre>
  
  <p><strong>AndroidManifest.xml</strong> - </p>
  
  <p></p>
  
  <pre><code>&lt;uses-sdk
      android:minSdkVersion="17"
      android:targetSdkVersion="22" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.BLUETOOTH"/&gt;
  &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" 
      android:name="MyApp"&gt;
      &lt;activity
          android:name="org.compani.proj.MainActivity"
          android:label="@string/app_name"
          android:launchMode="singleInstance"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>Release messages</strong> - </p>
  
  <pre><code>23:43:42: Executing external task 'assembleRelease'...
  Configuration on demand is an incubating feature.
  :app:preBuild
  :app:preReleaseBuild
  :app:checkReleaseManifest
  :app:preDebugBuild
  :app:prepareComAndroidSupportAppcompatV72200Library UP-TO-DATE
  :app:prepareComAndroidSupportCardviewV72103Library UP-TO-DATE
  :app:prepareComAndroidSupportRecyclerviewV72103Library UP-TO-DATE
  :app:prepareComAndroidSupportSupportV42200Library UP-TO-DATE
  :app:prepareOrgAltbeaconAndroidBeaconLibrary214Library UP-TO-DATE
  :app:prepareReleaseDependencies
  :app:compileReleaseAidl UP-TO-DATE
  :app:compileReleaseRenderscript UP-TO-DATE
  :app:generateReleaseBuildConfig UP-TO-DATE
  :app:generateReleaseAssets UP-TO-DATE
  :app:mergeReleaseAssets UP-TO-DATE
  :app:generateReleaseResValues UP-TO-DATE
  :app:generateReleaseResources UP-TO-DATE
  :app:mergeReleaseResources UP-TO-DATE
  :app:processReleaseManifest
  :app:processReleaseResources UP-TO-DATE
  :app:generateReleaseSources UP-TO-DATE
  :app:compileReleaseJava UP-TO-DATE
  :app:lintVitalRelease
  :app:compileReleaseNdk UP-TO-DATE
  :app:preDexRelease UP-TO-DATE
  :app:dexRelease UP-TO-DATE
  :app:processReleaseJavaRes UP-TO-DATE
  :app:packageRelease UP-TO-DATE
  :app:assembleRelease
  
  BUILD SUCCESSFUL
  
  Total time: 6.309 secs
  23:43:49: External task execution finished 'assembleRelease'.
  </code></pre>