0

Facing errors on my Gradle build in Android Studio. Where do I need to change the code to fix the issue? I am new to android app development.

This is my project build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
        maven { url 'https://jitpack.io' }
    }
}

this is my app build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28

    defaultConfig {
        applicationId "com.cisco.amp"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "2.0.0.0"
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        // Override versionName and versionCode if passed as arguments from build script
        if (project.hasProperty("versionName")) {
            versionName = project.property("versionName")
        }
        if (project.hasProperty("versionCode")) {
            def versionCodeStr = project.property("versionCode")
            if (versionCodeStr != null && !versionCodeStr.equals("")) {
                versionCode = Integer.valueOf(versionCodeStr)
            }
        }
    }

    signingConfigs {
        release {
            if (project.hasProperty("keyAlias")) {
                keyAlias = project.property("keyAlias")
            }
            if (project.hasProperty("keyPassword")) {
                keyPassword = project.property("keyPassword")
            }
            if (project.hasProperty("storeFile")) {
                storeFile = file(project.property("storeFile"))
            }
            if (project.hasProperty("storePassword")) {
                storePassword = project.property("storePassword")
            }
        }
    }

    buildTypes {
        debug {
            testCoverageEnabled true
        }

        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

    flavorDimensions "buildMode"
    productFlavors {

        automation {
            dimension "buildMode"
            applicationIdSuffix ".automation"
            versionNameSuffix "-automation"
        }

        prod {
            dimension "buildMode"
        }
    }

    testOptions {
        animationsDisabled true
    }

    jacoco {
        version '0.8.4'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.google.android.material:material:1.1.0-alpha06'
    implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha06'
    implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
    implementation 'androidx.annotation:annotation:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'

    testImplementation 'junit:junit:4.12'
    testImplementation 'androidx.test:core:1.2.0'

    androidTestImplementation 'androidx.test:core:1.2.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test:rules:1.2.0'
}

Error logs:

Task :app:validateSigningAutomationRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:validateSigningAutomationRelease'.
> Keystore file not set for signing config release
James Z
  • 12,104
  • 10
  • 27
  • 43
  • You should check this [link](https://stackoverflow.com/questions/27561146/issue-signing-android-release-build-failed-to-read-key-from-keystore). – Bhavik Parmar Nov 21 '19 at 05:55

1 Answers1

0

Able to resolve the issue by commenting out following 2 blocks of dependencies from my app build.gradle

        /*debug {
            testCoverageEnabled true
        }*/

and

    /*jacoco {
        version '0.8.4'
    }*/