未找到用于签名配置“发布"的密钥库 [英] Keystore Not Found for Signing Config 'release'
问题描述
我在 Flutter 上运行此命令时遇到问题:flutter build appbundle --target-platform android-arm,android-arm64,android-x64
我需要运行它才能执行flutter build apk
.
I'm having a problem while running this command on Flutter: flutter build appbundle --target-platform android-arm,android-arm64,android-x64
which I need to run in order to execute flutter build apk
.
build.gradle
build.gradle
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
}
key.properties
key.properties
storePassword=XXXX
keyPassword=XXXX
keyAlias=key
storeFile="C:/Users/User/Key/key.jks"
错误:
* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'D:\Projects\Flutter\iusefully\android\app\"C:\Users\User\Key\key.jks"' not found for signing config 'release'.
推荐答案
我终于找到了答案,我的问题出在 key.properties
文件中.出现问题是因为我使用了 storeFile="LOC"
.jks
路径的这个变量的声明不应该在 " "
引用.
I finally found the answer,
my problem was in the key.properties
file.
The problem occurred because I used storeFile="LOC"
The declartion of this variable for the path of the .jks
should NOT be in " "
quotation.
错误:storeFile="C:/Users/User/Key/key.jks"
右:storeFile=C:/Users/User/Key/key.jks
另外,我将 key.jks
文件添加到了 /app
文件夹中.
In addition, I added the key.jks
file to the /app
folder.
这篇关于未找到用于签名配置“发布"的密钥库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!