skip to Main Content

Execution failed for task ‘:app:packageDebug’.

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
com.android.ide.common.signing.KeytoolExcept

storePassword=finpro
keyPassword=finpro
keyAlias=fin
storeFile=/Users/macbookpro/Ongoing works/Finpro/fin_pro/keystore/fin-pro.jks

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

2

Answers


  1. Use the keytool command to list the aliases in the keystore and verify that the alias "fin" exists. Ensure that the alias "fin" is present in the output.

    keytool -list -v -keystore /Users/macbookpro/Ongoing works/Finpro/fin_pro/keystore/fin-pro.jks
    

    after that, sync your project with Gradle files and perform a clean build:

    ./gradlew clean
    ./gradlew assembleRelease
    
    Login or Signup to reply.
  2. I don’t know what exactly did you do to mess it up, but here’s what works for me always across projects

    1. Create a secrets.properties file at the root level
    2. Add the following keys and values as per requirement(Ensure no whitespaces)
    DEBUG_KEY_ALIAS=
    DEBUG_KEYSTORE_PASSWORD=
    DEBUG_KEY_PASSWORD=
    RELEASE_KEY_ALIAS=
    RELEASE_KEYSTORE_PASSWORD=
    RELEASE_KEY_PASSWORD=
    
    1. Load them in your app level build.gradle.kts file as follows
    // Load property file
    val properties = Properties()
    val propertyFile = File(rootDir, "secrets.properties")
    InputStreamReader(FileInputStream(propertyFile), Charsets.UTF_8).use { reader -> properties.load(reader)
    }
    
    android {
    
    signingConfigs {
      create("my_release_config"){
         storeFile = file("keystore/release.keystore") // Should be in the root folder
         keyAlias = properties.getProperty("RELEASE_KEY_ALIAS", "default")
         keyPassword = properties.getProperty("RELEASE_KEYSTORE_PASSWORD", "default")
         storePassword = properties.getProperty("RELEASE_KEYSTORE_PASSWORD", "default")
      }
    }
    
    }
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search