Aniruddha-Tapas / Document-Scanner

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

ERROR: Could not get unknown property 'config' for SigningConfig container. #15

Open karthickperumal opened 4 years ago

karthickperumal commented 4 years ago

After cloning and run the app getting the below error

ERROR: Could not get unknown property 'config' for SigningConfig container.

Please share me the solution to fix.

Venkat-juju commented 4 years ago

Same error here!!!

Venkat-juju commented 4 years ago

add the below before buildTypes will help you to get out from that error

signingConfigs {
        myconfig {
            keyAlias 'xxx'
            keyPassword 'xxx'
            storeFile file('xxx')
            storePassword 'xxx'
        }
    }
mehmoodusman commented 4 years ago

I'm also getting same error Could not get unknown property 'config' for SigningConfig container. after adding the signingConfig {.....} info Please tell me how to fix it

AyushKoul00 commented 4 years ago

Did anyone find a fix? I tried adding the signingConfigs{...} before buildTypes but it still gives me that error. Can someone guide me because I just cloned this into android studio and I am getting this 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!