为属性“signingConfig.storeFile”指定的 Android 不存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25211444/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android specified for property 'signingConfig.storeFile' does not exist
提问by Pachu
Im trying to generate signed APK Using AndroidStudio but I get this error:
我正在尝试使用 AndroidStudio 生成签名的 APK,但出现此错误:
Error:A problem was found with the configuration of task ':app:packageRelease'.
> File 'com.pachu.fartsound' specified for property 'signingConfig.storeFile' does not exist.
i dont know if you need it but there is my build.gradle:
我不知道你是否需要它,但有我的 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'
}
采纳答案by Nikolay Hristov
Go to Build -> Generate Signed APK. Create your key (or choose existing) -> next -> next -> done!
转到构建 -> 生成签名的 APK。创建您的密钥(或选择现有的)-> 下一个-> 下一个-> 完成!
If you want to do it "hard way" you need to specify already created release key into signingConfigs before buildTypes. Something like this:
如果您想以“困难的方式”执行此操作,则需要在 buildTypes 之前将已创建的发布密钥指定到签名配置中。像这样的东西:
signingConfigs {
release {
storeFile file("/yourkey.jks") //check that the file exists
storePassword "YourPassword"
keyAlias "YourAlias"
keyPassword "YourPassword"
}
}
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.
但这有点没用。因为 Android Studio 提供了非常简单易用的方法来创建准备发布的签名 APK 文件。并且还将您的密钥密码指定到 build.gradle 文件中...... - 就安全而言,不建议这样做。
回答by Voy
My key was in
我的钥匙在
APPROOT/myKey.jks
Whilst the gradle was looking in
虽然gradle正在寻找
APPROOT/app/myKey.jks
I think you specify that second path on the second dialogue when you generate the signed apk, but I haven't checked it out, can someone confirm?
我认为您在生成签名的 apk 时在第二个对话中指定了第二条路径,但我没有检查过,有人可以确认吗?
回答by xevser
Make sure that you write the extension of the keystore file when firstly creating.
确保您在首次创建时编写了密钥库文件的扩展名。
回答by Gene
Try rebuilding the project. So go to Build-> Clean Project. Then generate the signed APK file again (Build -> Generate Signed APK).
尝试重建项目。所以去Build-> Clean Project。然后再次生成签名的 APK 文件(构建 -> 生成签名的 APK)。
回答by AKASH WANGALWAR
I was also getting the same error. The mistake I made was storing the keystore in the application's "app"
package and providing the same path to android studio.
我也遇到了同样的错误。我犯的错误是将密钥库存储在应用程序的"app"
包中并提供与 android studio 相同的路径。
Just remove the keystore and place another than your android application's ""
package.
只需删除密钥库并放置另一个而不是您的 android 应用程序""
包。
回答by Dominic Wardslaus Rubhabha
Change Permissions for the app folder to 777 for everyone.The reason is because Android Studio is failing to write to the folder
将app文件夹的Permissions改为777,原因是Android Studio写入文件夹失败