How to fix INSTALL_PARSE_FAILED_NO_CERTIFICATES for xiaomi/redmi/miui while debugging?

4,040

Solution 1

Go to Phone Developer Settings.

and on/off the verify apps over USB enter image description here

Solution 2

In my case I was getting this error when trying to run flutter in release mode (flutter run --release) and it was because my app level build gradle (..android/app/build.gradle) wasn't set up correctly.

You need to make sure you have "signingConfigs" object inside of the "android" object, and also the corresponding "buildType" set up

e.g.

android {
    compileSdkVersion 30

    lintOptions {
        disable 'InvalidPackage'
    }

    signingConfigs {
        release {
            storeFile file('<path to key store file>')
            storePassword '<key store password>'
            keyAlias '<key alias>'
            keyPassword '<key password>'
        }
        debug {
            storeFile file('<path to key store file>')
            storePassword '<key store password>'
            keyAlias '<key alias>'
            keyPassword '<key password>'
        }
    }  

    defaultConfig {
        applicationId "XXXXXXXXXXX"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
        debug {
            signingConfig signingConfigs.debug
        }
    }
}
Share:
4,040
Nanda R.M
Author by

Nanda R.M

Updated on December 17, 2022

Comments

  • Nanda R.M
    Nanda R.M over 1 year

    I only have this error message when using my xiaomi redmi note 7 (pie). I was using my previous phone is redmi 2 and still work. I try to debug from flutter or android studio project still got the same error. When I want to try debug to my friend phone Samsung A50 it's working perfectly. I was try anything from this answer but none of its working for me.

    From Flutter

    Error: ADB exited with exit code 1
    Performing Streamed Install
    
    adb: failed to install D:\pks\flutter\delisia\build\app\outputs\apk\app.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl1357086466.tmp/base.apk using APK Signature Scheme v2: SHA-256 digest of contents did not verify]
    Error launching application on Redmi Note 7.
    

    From Android Studio

    11:12 AM    Session 'app': Installation did not succeed.
                        The application could not be installed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
                        Retry
    
    11:14 AM    Executing tasks: [:app:assembleDebug] in project D:\kuliah\Aplikasi\MoLearn
    
    11:14 AM    Gradle build finished in 7 s 93 ms
    
    11:14 AM    Failed to commit install session 652017913 with command cmd package install-commit 652017913. Error: INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl652017913.tmp/0_app-debug using APK Signature Scheme v2: SHA-256 digest of contents did not verify
    
    11:14 AM    Session 'app': Installation did not succeed.
                        The application could not be installed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
                        Retry
    

    So, i can debug using my phone, I'm only can debug from my emulator nox and its so slow. But i dunno why somethime the app is installed on my phone redmi note 7, and when i try to update some code the app is uninstalled automatically and the error is showing again.

    I can install my own app from play store, but its an release app. I can't debug from it.