我无法创建Flutter应用程序。
我写在VSCode的最后。
flutter build appbundle --release
但失败了
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\NAME\source\repos\NAME\work\flutter\APP_NAME\android\app\build.gradle' line: 58
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not get unknown property 'keystoreProperties' for SigningConfig$AgpDecorated_Decorated{name=release, storeFile=null, storePassword=null, keyAlias=null, keyPassword=null, storeType=pkcs12, v1SigningEnabled=true, v2SigningEnabled=true, enableV1Signing=null, enableV2Signing=null, enableV3Signing=null, enableV4Signing=null} of type com.android.build.gradle.internal.dsl.SigningConfig$AgpDecorated.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
build.gradle'行:58是从keyAlias开始的一行…
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
我在android\app\build.gradle添加了这些代码
enter image description here
我做了android\app\key.jks
android\key.properties
storePassword=MYPASSWORD
keyPassword=MYPASSWORD
keyAlias=key
storeFile=key.jks
2条答案
按热度按时间whhtz7ly1#
你需要添加这样的代码来初始化keystoreProperties,例如在文件顶部的其他“def”语句下面:
s4n0splo2#
问题解决了。