Android Install error with release unsigned apk

2.7k views Asked by At

I try to install an application on release build type and I get the generic error: "Parse error. There was a problem while parsing the package"

Installing the debug apk works successfully.

Installing release apk with adb shows this information:

C:\android-sdk-windows\platform-tools>adb install app-release-unsigned.apk

2577 KB/s (1606360 bytes in 0.608s) pkg: /data/local/tmp/app-release-unsigned.apk

Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

This is the logcat

V/ApplicationPolicy: isApplicationStateBlocked userId 0 pkgname com.android.packageinstaller I/ActivityManager: START u0 {act=android.intent.action.VIEW dat=file:///storage/emulated/0/Download/app-> > release-unsigned.apk typ=application/vnd.android.package-archive cmp=com.android.packageinstaller/.PackageInstallerActivity (has extras)} from uid 10019 on display 0

D/CustomFrequencyManagerService: acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 1190400 uid : 1000 pid : 961 pkgName : ACTIVITY_RESUME_BOOSTER@4

W/ActivityManager: mDVFSHelper.acquire() D/InputDispatcher: Focused application set to: xxxx D/InputDispatcher: Focus left window: 22409 /? D/MyFiles: FileUtils::update file open count D/DisplayManager: addAllDisplaysLocked() D/ActivityManager: Launching com.android.packageinstaller, updated priority D/SSRM:a: DeviceInfo:: 000000000000 D/SSRM:a: SettingsAirViewInfo:: 000000000 /?

W/PackageInstaller: Parse error when parsing manifest. Discontinuing installation

The module build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "xxxxxx.yyyy.zzzzz"
        minSdkVersion 21
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            debuggable true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')        
    compile project(':SAPE.Lib')
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.android.support:appcompat-v7:21.0.3'
}
1

There are 1 answers

0
Viral Patel On BEST ANSWER

You are installing the unsigned apk using the command

adb install app-release-unsigned.apk

When generating the signed apk remember the path to which you are saving the signed apk and install the apk from that location. It should install fine.