在flutter build appbundle --target-platform android-arm,android-arm64,android-x64上运行这个命令时遇到了问题,我需要运行这个命令才能执行flutter build apk。
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
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'.发布于 2020-06-04 06:09:07
我终于找到了答案,我的问题是在key.properties文件中。问题发生是因为我使用了storeFile="LOC",.jks路径的这个变量的声明不应该在" "引号中。
错:storeFile="C:/Users/User/Key/key.jks"
右:storeFile=C:/Users/User/Key/key.jks
此外,我还将key.jks文件添加到/app文件夹中。
发布于 2021-04-30 02:35:27
这个解决方案对我有用..。按照这条指令
https://flutter.dev/docs/deployment/android#create-a-keystore
在key.properties中,不要将值放在"" ex中:
storePassword=454545
keyPassword=456565
keyAlias=upload
storeFile= C:/Users/{profile}/upload-keystore.jks发布于 2020-06-03 13:16:58
把你的关键位置c改为d.同时,c驱动器也发生了权限问题。
https://stackoverflow.com/questions/62173655
复制相似问题