Android Studio与模拟器安装调试失败:INSTALL_PARSE_FAILED_NO_CERTIFICATES

我是运行在夜神模拟器上失败的,模拟器的安卓版本为7.1,签名打包然后安装没问题,但是直接run到模拟器就install失败,现已解决,记录一下

Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
APK signature verification failed.

Android Studio与模拟器安装调试失败:INSTALL_PARSE_FAILED_NO_CERTIFICATES_第1张图片

解决办法:

第一步:在app目录下的build.gradle文件中android {}内配置签名参数 

signingConfigs {
        debug {
            keyAlias 'androiddebugkey'
            keyPassword 'android'
            storeFile file('D:\\Android\\AndroidStudioProject\\debug.keystore')
            storePassword 'android'
            v1SigningEnabled true
            v2SigningEnabled true
        }
        release {
            keyAlias 'androiddebugkey'
            keyPassword 'android'
            storeFile file('D:\\Android\\AndroidStudioProject\\debug.keystore')
            storePassword 'android'
            v1SigningEnabled true
            v2SigningEnabled true
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
        debug{
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.debug
        }

第二步:配置主工程

Android Studio与模拟器安装调试失败:INSTALL_PARSE_FAILED_NO_CERTIFICATES_第2张图片

 上述操作运行完成就会将代码成功运行到模拟器上

你可能感兴趣的:(android,android模拟器)