0

I am trying to make a new build type that has a different resource directory than the existing debug type. This is the code that I add to my build.gradle.

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
    debug {
        applicationIdSuffix '.debug'
    }
    Test {
        applicationIdSuffix '.debug'
    }
}

When building the'test' type Android Studio throws this error.

enter image description here

I've found posts that suggests including a some signing configuration in the gradle file.

signingConfigs{
unsigned{
    storePassword = ""
    keyAlias = ""
    keyPassword = ""
}

buildTypes{
    ...
    test {
        signingConfig signingConfigs.unsigned
    }
    ...
}

But adding...

signingConfig signingConfigs.unsigned

...results in an error as the "signingConfig" datatype can't be found.

Community
  • 1
  • 1
Josh Taylor
  • 171
  • 1
  • 7
  • You need to create a key and a keystore. http://developer.android.com/tools/publishing/app-signing.html – Djordje Tankosic Jul 24 '15 at 03:16
  • I should have been clearer. I want this build type to be unsigned, like the default 'debug' type. I doing this because I want two debug builds with different resource directories to store information about their test environment. – Josh Taylor Jul 24 '15 at 03:21
  • 1
    Maybe we don't need to specify a `signingConfig` in your buildTypes entry `test` – ecle Jul 24 '15 at 03:46
  • @eee I appreciate your answer. I gave it a try. I can build the app in the 'Test' build type, but I get the error pictured above when I try to run it on my device. – Josh Taylor Jul 24 '15 at 03:58
  • 1
    The default debug type is signed. It is an automatically generated certificate that Android studio uses. It expires one year after Android studio was installed. http://developer.android.com/tools/publishing/app-signing.html#overview – Jon Jul 24 '15 at 03:59
  • Thanks, that's an interesting fact. Do you know how I can configure my new 'Test' build type to use the generated certificate. – Josh Taylor Jul 24 '15 at 04:06
  • @JoshTaylor http://stackoverflow.com/questions/18328730/how-to-create-a-release-signed-apk-file-using-gradle and http://stackoverflow.com/questions/21780847/gradle-signing-app-with-packagerelease-specified-for-property-signingconfig-st – IntelliJ Amiya Jul 24 '15 at 05:25

0 Answers0