10

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.

Nanda R.M
  • 203
  • 2
  • 3
  • 13
  • Are you using multiple user or there is a app already installed. if so uninstall it – Dev Feb 13 '20 at 04:28
  • The one in play store is using multiple user. But even i make new project that only show "hello world" the error still exist. But everything okay when i run it on emulator or my old phone ;v. – Nanda R.M Feb 13 '20 at 10:15
  • switch to other user and uninstall the app from all user. – Dev Feb 13 '20 at 10:16
  • same me too.I restart my xiaomi phone that is fine but error again when run again.How to solve that problem – H Zan Jan 09 '21 at 20:09

6 Answers6

16

Go to Phone Developer Settings.

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

cokeman19
  • 2,405
  • 1
  • 25
  • 40
Anil Mehta
  • 161
  • 1
  • 6
9

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
        }
    }
}
Chris
  • 1,720
  • 16
  • 35
3

in your android/app/build.gradle at the bottom of the android section, add build types:

android{
  ...
   buildTypes {
    release {
        signingConfig signingConfigs.debug
    }
   }
}

in case of release you may need to change the .debug to .release. It fixed my problem :D

Ayyaz meo
  • 450
  • 5
  • 13
0

If you use Android Studio and use Nox as the emulator, adjust at least the SDK version! If NOX uses SDK version 22, change the minimum SDK in gradle settings to version 22! Hope it helps you: D

0

Just go to Phone Developer Settings.

  1. Switch On Debugging Mode (you already did)
  2. Switch On Install via USB.
  3. Change settings MIUI optimization Setting (End Item in Developer setting.
Deepak Ror
  • 2,084
  • 2
  • 20
  • 26
0

In my case, this was due to updating Android Studio 4.0. Upgrading flutter and pubs worked for me:

flutter upgrade
flutter pub upgrade
luchin
  • 52
  • 5