I need to generate an unsigned, release APK (where someone else will then sign it and release it to the store- with the someone else handling the keys and everything else). My problem is that Android Studio throws an error whenever I try to build:
app-flavorUnsigned-release-unsigned.apk is not signed. Please configure the signing information for the selected flavor using the Project Structure dialog.
I've tried several, previous methods:
gradle assemble
or gradle assembleRelease
(which fail due to one of my important module libraries trying to be built)Here is my current [app's] build.gradle:
apply plugin: 'com.android.application'
android {
signingConfigs {
unsigned {
storePassword = ""
keyAlias = ""
keyPassword = ""
}
}
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "hiddenForClientPrivacy"
minSdkVersion 13
targetSdkVersion 20
versionCode 1
versionName "1.0"
signingConfig signingConfigs.unsigned
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.unsigned
}
unsignedBuild {
debuggable false
versionNameSuffix '-unsigned'
signingConfig signingConfigs.unsigned
}
debug {
}
}
productFlavors {
flavorUnsigned {
versionCode = 1;
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:20.0.0'
compile project(':SlidingMenu')
compile 'com.android.support:support-v13:20.0.0'
compile 'com.github.castorflex.verticalviewpager:library:19.0.1'
}
Thank you for any and all help.
Post-Help Edit: As the marked accepted answer shows, I had to clear out the release block. Furthermore, I was clicking on the "Run" button- which should appropriately show an error as I can't run an unsigned release apk on an emulator or device. The accepted answer describes everything.
Unsigned Apk, as the name suggests it means it is not signed by any Keystore. A Keystore is basically a binary file that contains a set of private keys. Every App that we install using the Google Play App Store needs to be signed with a Keystore.
Open the Settings app on your Android device. Tap the “Security” option in the Personal section. Tap the check box next to Unknown Sources. This enables your device to install unsigned, third-party apps from sources other than the Google Play app store.
If you need to install such an app for your Android device, you can still do so, but you'll need to enable settings inside Android that enable you to install unsigned third-party apps. These settings are located inside the Android Settings app.
In the release
build type, don't specify a signingConfig
at all, and your build won't be signed. Release builds don't pick up the default signing config that debug builds get, so it should work for those.
There's a discussion on the adt-dev mailing list about it.
Bear in mind that to build from Android Studio, you'll need to go to the Gradle tasks window and choose the assembleRelease
task; normal builds via "Make Project" don't actually build the final APK.
Actually you can build an unsigned .APK just by building it:
To generate it, on the left side of the Android Studio, there is a Build Variants menu (maybe written vertically). Click it.
The Build Variants window tab has appeared, click debug and change it by release.
Rebuild your project application > Build > Rebuild Project.
Then click Run, a new window has appeared, click Run > Continue anyway > Choose the device you want to run with > OK.
The application won't work on your device but the release build version, of your .apk, will be generated into the same directory as your debug ones:
You can note that the name is app-release-unsigned.apk and it was exactly what we wanted to have.
More information on this tutorial website.
I had to do the same thing (because app signing is handled elsewhere) and I simply rebuilt the project.
To generate an unsigned release apk, select a release version in the Build Variants menu.
Note: You may get a red cross in your app configuration on the top menu, ignore it.
Rebuild your project application Build > Rebuild Project.
You will find your app-release-unsigned.apk in:
Note: If you need to create other versions, save the generated apk because subsequent rebuilds will overwrite the current apk(...don't be like me).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With