应用无法安装:INSTALL_PARSE_FAILED_NO_CERTIFICATES。

8
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

我已经尝试过以下操作:
  1. 使应用程序无效并重新启动。
  2. 构建Bundle/APK。
  3. 删除应用程序后在手机上安装APK并运行APK。
  4. 增加版本代码和版本名称。
生成apk文件是有效的,但是使用apk文件安装并运行时出现问题。 可以通过以下步骤生成签名的Bundle或APK:进入工具→生成签名的Bundle或APK→选择现有项→下一步→勾选V1 Debug、Release→完成。 虽然这种方法能够生成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个回答

0

我的情况是我们的应用程序包名为com.a.b,并依赖于一个名为com.a.c的库,但同时该库还有演示应用程序com.a.c.d
在删除com.a.c.d后,我的应用程序成功安装。

当我使用不可靠的USB连接电缆时,也会出现这个问题。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接