<aside> 🔐 Dashwave does not create signing configuration (keystore) for your project. We use your own signing configuration to sign the APKs during build process.

</aside>

Ingredients needed for signing beforehand to build signed APK - ◦ storeFilestorePasswordkeyAliaskeyPassword

In your Gradle settings (build.gradle or build.gradle.kts) in your module level directory, you can explicitly set the code signing details to ensure that the app is signed as it's being built.

For more information on signing, check out Gradle build signing

Example configuration in build.gradle of module

signingConfigs {
        create("release") {
            storeFile = file("\\\\dashwave\\\\keystore\\\\keystore")
            storePassword = "******"
            keyAlias = "dashwave"
            keyPassword = "*****"
        }
    }

Change variant in build configuration

To build a signed APK of a different variant, you will need to change the build configuration either through the Project Settings or you can use Build Flags. To learn how refer here: Builds

Different ways to define Signing Configuration

<aside> 🔑 In any below case, dw build uses your own keystore, which will be detected and uploaded automatically on dw cloud by DW-CLI.

</aside>

If keystore is included in .gitignore of your project, you need to run this CLI command to sync your keystore.

dw sign path-to-keystore 

//Run this command from root directory of project only

1. Signing configuration in the build.gradle file

In this example, dw build will use the configuration as it is.

android {
   // Make sure signingConfigs is defined before buildTypes.
   signingConfigs {
           release {
         keyAlias 'MyAndroidKey'
         keyPassword '***'
         storeFile file("/path/to/my/keystore.jks")
         storePassword '***'
       }
   }

  buildTypes {
      release {
          // Use signing config for build type
          signingConfig signingConfigs.release
          // ...
      }
  }
  // ...

2. Using Environment Variables in the build.gradle file

Make sure to define the Environment Variables you use in your build.gradle file on console.dashwave.io Project setting page as well.

android {
   signingConfigs {
       release {
         keyAlias System.getenv("KEYSTORE_ALIAS")
         keyPassword System.getenv("KEYSTORE_KEY_PASSWORD")
         storeFile file("/path/to/my/keystore.jks")
         storePassword System.getenv("KEYSTORE_PASSWORD")
       }
   }

   buildTypes {
      release {
          // Use signing config for build type
          signingConfig signingConfigs.release
          // ...
      }
   }
   ..

If you use Environment Variables as keyPassword and storePassword on the Code signing tab as System.getenv("ENV_KEY"), your build.gradle will look like this