skip to Main Content

I’m running flutter build appbundle command and getting the error you can see on the image. what’s wrong in signingConfigs.

   signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
   }
   buildTypes {
       release {
           signingConfig signingConfigs.release
       }
   }

enter image description here

4

Answers


  1. Chosen as BEST ANSWER

    Got the Error solved: Could not get unknown property 'keystoreProperties'

    Replaced this code:

    def localProperties = new Properties()
    def localPropertiesFile = rootProject.file('local.properties')
    if (localPropertiesFile.exists()) {
        localPropertiesFile.withReader('UTF-8') { reader ->
            localProperties.load(reader)
        }
    }
    

    With this code: in android/app/build.gradle file.

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

    as suggested here: https://docs.flutter.dev/deployment/android#configure-signing-in-gradle


  2. It might be possible that you are missing keystoreProperties file. This file is typically not checked in to source control, so if you are collaborating with others, ask your friends or coworkers to send you that file.

    Login or Signup to reply.
  3. @WSBT is correct after that use code below

    signingConfigs {
            release {
                keyAlias keystoreProperties['keyAlias']
                keyPassword keystoreProperties['keyPassword']
                storeFile file(keystoreProperties['storeFile'])
                storePassword keystoreProperties['storePassword']
            }
        }
    
    Login or Signup to reply.
  4. You have to add the below file into an android folder directly.

    location

    Inside the key.properties write the below code

     storePassword="storepassword"
     keyPassword="keypassword"
     keyAlias=upload
     storeFile=/Users/...your..keystore..location/keystore.jks
    

    Also, update the android/app/build.gradle file

    def keystoreProperties = new Properties()
    def keystorePropertiesFile = rootProject.file('key.properties')
    if (keystorePropertiesFile.exists()) {
       keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search