Aniruddha-Tapas / Document-Scanner

Source code for the Capstone Project of Udacity Android Developer Nanodegree
GNU General Public License v3.0
363 stars 140 forks source link

myConfigs is unknown for signingConfig #8

Open zameelpichen opened 6 years ago

zameelpichen commented 6 years ago

There is no code block found for myConfig

this error appears

Error:(19, 0) Could not get unknown property 'myConfigs' for SigningConfig container of type org.gradle.api.internal.FactoryNamedDomainObjectContainer. Open File

LamraniOthmane commented 6 years ago

For those who are still facing this issue try to add your signingConfigs like this (it worked for me)

signingConfigs { config { keyAlias 'xxx' keyPassword 'xxx' storeFile file('xxx') storePassword 'xxx' } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        signingConfig signingConfigs.config
    }
}
yashlinmaistry commented 5 years ago

I had the same issue

What worked for me was making sure signingConfigs is before productFlavors.

e.g. defaultConfig {} signingConfigs {} productFlavors {} buildTypes {}

AyushKoul00 commented 4 years ago

I had the same issue

What worked for me was making sure signingConfigs is before productFlavors.

e.g. defaultConfig {} signingConfigs {} productFlavors {} buildTypes {}

Hi, I tried this but it still gives me the same error.

Aniruddha-Tapas commented 4 years ago

In order to create a signed release APK, you'll have to specify your own sigining configuration. You can edit the app/build.gradle to:

android {
    ...
    signingConfigs {
        release {
            storeFile file("../keystore/keystore.jks")
            storePassword "******"
            keyAlias "******"
            keyPassword "******"
        }
    }
    ...
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}

You can learn more about signing configs with gradle here.

Moreover if you don't need a signed apk, you can simply remove the line

signingConfig signingConfigs.config

from the gradle file. Thanks for pointing it out!