为属性“signingConfig.storeFile"指定的 Android 不存在 [英] Android specified for property 'signingConfig.storeFile' does not exist

查看:29
本文介绍了为属性“signingConfig.storeFile"指定的 Android 不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 AndroidStudio 生成签名的 APK,但出现此错误:

Im trying to generate signed APK Using AndroidStudio but I get this error:

    Error:A problem was found with the configuration of task ':app:packageRelease'.
> File 'com.pachu.fartsound' specified for property 'signingConfig.storeFile' does not exist.

我不知道你是否需要它,但有我的 build.gradle:

i dont know if you need it but there is my build.gradle:

    apply plugin: 'com.android.application'
apply plugin: 'android'
android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.pachu.fartsounds"
        minSdkVersion 9
        targetSdkVersion 19
        versionCode 1
        versionName "1.2"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
    compile 'com.google.android.gms:play-services:5.0.89'
}

推荐答案

Go to Build -> Generate Signed APK.创建您的密钥(或选择现有的)-> 下一个-> 下一个-> 完成!

Go to Build -> Generate Signed APK. Create your key (or choose existing) -> next -> next -> done!

如果您想以困难的方式"执行此操作,则需要在 buildTypes 之前将已创建的发布密钥指定到签名配置中.像这样:

If you want to do it "hard way" you need to specify already created release key into signingConfigs before buildTypes. Something like this:

signingConfigs {
        release {
            storeFile file("/yourkey.jks") //check that the file exists
            storePassword "YourPassword"
            keyAlias "YourAlias"
            keyPassword "YourPassword"
        }
    }

但这有点没用.因为 Android Studio 提供了非常简单易行的方法来创建准备发布的签名 APK 文件.并且还将您的密钥密码指定到 build.gradle 文件中... - 出于安全考虑,不建议这样做.

But this is useless somewhat. Because Android Studio provides very simple and easy way to create a signed APK file ready for publishing. And also specifying your key's password into the build.gradle file... - it isn't advisable to do it in terms of security.

这篇关于为属性“signingConfig.storeFile"指定的 Android 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆