Forum Discussion

Monika160's avatar
Monika160
Copper Contributor
Jan 03, 2024

while releasing apk for flutter application getting an error

while releasing apk for flutter application in azure devops piplines getting an error as 

FAILURE: Build failed with an exception.
 
* What went wrong:
Execution failed for task ':app:packageRelRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> SigningConfig "release" is missing required property "storeFile".
 
and also i  have stored jks file in secure file and with key.properties file but still am getting this error.
 
can anyone can help us..?
  • charleslouis879's avatar
    charleslouis879
    Copper Contributor

    Monika160 

    To resolve the issue with releasing your APK in Azure DevOps pipelines, follow these steps:

    ### 1. Verify `key.properties` File
    Ensure your `key.properties` file has the correct path and details:

    ```properties
    storePassword=your_store_password
    keyPassword=your_key_password
    keyAlias=your_key_alias
    storeFile=/path/to/your/keystore.jks
    ```

    ### 2. Update `build.gradle`
    Ensure the `key.properties` file is correctly referenced in `android/app/build.gradle`:

    ```groovy
    def keystoreProperties = new Properties()
    def keystorePropertiesFile = rootProject.file('key.properties')
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

    android {
    signingConfigs {
    release {
    keyAlias keystoreProperties['keyAlias']
    keyPassword keystoreProperties['keyPassword']
    storeFile file(keystoreProperties['storeFile'])
    storePassword keystoreProperties['storePassword']
    }
    }
    buildTypes {
    release {
    signingConfig signingConfigs.release
    }
    }
    }
    ```

    ### 3. Check Secure Files in Azure DevOps
    Ensure your keystore file and `key.properties` are correctly stored.  and accessed in Azure DevOps secure files. 

    ### 4. Reference Secure Files in Pipeline
    Ensure your pipeline script correctly references the secure files:

    ```yaml
    - task: DownloadSecureFile@1
    name: keystoreFile
    inputs:
    secureFile: 'your_keystore_file.jks'

    - script: |
    mkdir -p android/app
    cp $(keystoreFile.secureFilePath) android/app/your_keystore_file.jks
    displayName: 'Copy keystore file'
    ```

    These steps should help resolve the issue with the signing configuration. i did same for my website Atlas Trip Tour

Resources