1

I use Jenkins to build debug-apk and release-apk,and I also want to get an unsigned.apk.But there is no unsigned.apk at app\build\outputs\apk, only app-debug.apk and app-debug-unaligned.apk.I searched,but everybody say it is there.

Build Unsigned APK with Gradle this can get an unsigned apk,but

buildTypes {
    release {
        minifyEnabled true
        shrinkResources true
        proguardFile 'proguard_gradle.cfg'
        signingConfig signingConfigs.c
    }
    debug {
        minifyEnabled true
        shrinkResources true
        proguardFile 'proguard_gradle.cfg'
        signingConfig signingConfigs.c
    }
}

I need sign apk at release mode and debug mode.

Can any one helps me

Community
  • 1
  • 1

1 Answers1

0

I solve it.

 signingConfigs {
    if (System.properties['sign'].equals("true")) {
        c {
            keyAlias 'a'
            keyPassword 'a'
            storeFile file('a')
            storePassword 'a'
        }
    } else {
        c {
            keyAlias ''
            keyPassword ''
            storePassword ''
        }
    }

}

at gradle.properties

systemProp.sign=true