无法安装应用程序:INSTALL_PARSE_FAILED_NO_CERTIFICATES

Posted

技术标签:

【中文标题】无法安装应用程序:INSTALL_PARSE_FAILED_NO_CERTIFICATES【英文标题】:The application could not be installed: INSTALL_PARSE_FAILED_NO_CERTIFICATES 【发布时间】:2020-02-27 09:57:57 【问题描述】:
11:45   Gradle build finished in 38 s 984 ms

11:45   Failed to commit install session 80875563 with command cmd package install-commit 80875563.

 Error: INSTALL_PARSE_FAILED_NO_CERTIFICATES: Package /data/app/vmdl80875563.tmp/0_app-release has no certificates at entry androidManifest.xml

11:45   Session 'app': Installation did not succeed.
                The application could not be installed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
                Retry

我试过了:

    无效并重新启动。

    构建包/APK

    删除应用后在手机中安装APK并运行apk

    版本代码,版本名称增加

(生成 apk 有效)但是(run 'app' 和使用 apk 安装无效)

工具→生成签名包或apk→选择exisitng→下一步→检查V1调试,发布→完成

此方法生成apk,但我的手机在使用此apk时无法安装

-----build.gradle (project) -----
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript 

    repositories 
        google()
        jcenter()
        maven  url 'https://maven.fabric.io/public' 
    
    dependencies 
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath 'com.google.gms:google-services:3.2.0'
        classpath 'io.fabric.tools:gradle:1.+'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    


allprojects 
    repositories 
        google()
        jcenter()
        maven  url "https://maven.google.com" // Google's Maven repository
        
        maven  url "https://jitpack.io" 
    

    tasks.withType(JavaCompile) 
        options.encoding = 'UTF-8'
    


task clean(type: Delete) 
    delete rootProject.buildDir




-----build.gradle(app)-----

android 
    compileSdkVersion 26
    signingConfigs 
        config 
            keyAlias '-'
            keyPassword '-'
            storeFile file('Insert KeystorePath')
            storePassword '-'
            v2SigningEnabled false
        
    

    defaultConfig 
        applicationId "root packagepath"
        minSdkVersion MIN_SDK_VERSION as int
        targetSdkVersion TARGET_SDK_VERSION
        versionCode VERSION_CODE as int
        versionName VERSION_NAME
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    
    buildTypes 
        release 
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
            debuggable false
            minifyEnabled false
        
        debug 
            signingConfig signingConfigs.config
            debuggable true
        
    
    productFlavors 
    
    dexOptions 
        jumboMode true
        javaMaxHeapSize "4g"
    
    lintOptions 
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    



-----gradle.properties-----
org.gradle.jvmargs=-Xmx1536m

VERSION_NAME=2.1.9
VERSION_CODE=33

COMPILE_SDK_VERSION=28
TARGET_SDK_VERSION=28
MIN_SDK_VERSION=21

【问题讨论】:

【参考方案1】:

在这个问题中,我也发现 Instant Run 有问题。当我禁用即时运行并再次运行应用程序时,应用程序开始在设备中成功安装,而不显示任何错误窗口。我希望谷歌能尽快通过 Instant run 解决这些问题。

从 Android Studio 禁用 Instant Run 的步骤:

文件 > 设置 > 构建、执行、部署 > 即时运行 > 取消选中(启用即时运行到热交换代码)

【讨论】:

以上是关于无法安装应用程序:INSTALL_PARSE_FAILED_NO_CERTIFICATES的主要内容,如果未能解决你的问题,请参考以下文章

安装程序无法自动安装网络自检wfp驱动程序

无法安装企业应用程序 - 此配置文件无法安装在此设备上

电脑无法正常安装程序出现无法打开要写入的文件

电脑无法安装程序 急急急!!

Xamarin 错误 ios Simulator HE0046: 无法安装应用程序...无法安装请求的应用程序

为啥我安装的应用程序无法运行?