I failed to build flutter app.
I wrote in tarminal of VSCode.
`flutter build appbundle –release““
but failed.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:UsersNAMEsourcereposNAMEworkflutterAPP_NAMEandroidappbuild.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’ line: 58 is a line starts from keyAlias…
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
I added these code at androidappbuild.gradle
and I made androidappkey.jks
and I modified androidkey.properties
storePassword=MYPASSWORD
keyPassword=MYPASSWORD
keyAlias=key
storeFile=key.jks
2
Answers
The problem was solved.
You need to add code like this to initialize the keystoreProperties, for example below the other "def" statements at the top of the file: