[Solved]Flutter Could not get unknown property ‘keystoreProperties’ for SigningConfig$AgpD….

2023/02/12 23:07

 

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Launching libmain.dart on AOSP on IA Emulator in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* Where:
Build file 'C:UsersEddyStudioProjectsvisual-editor-developiTwiandroidappbuild.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.

* Get more help at https://help.gradle.org

BUILD FAILED in 24s
Exception: Gradle task assembleDebug failed with exit code 1

Solution

Add the following code before android code block in C:UsersUserStudioProjectsvisual-editor-developMyAppNameandroidappbuild.gradle


def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

                    

Leave a Reply

Back to top