I am attempting to generate a signed APK for my app. I'm using Android Studio to generate the release APK: build > generate signed APK. I then get a popup for my key store, alias, and passwords. This process has worked in the past but, I suspect, stopped working after a recent upgrade of tools and other support. What can I do to get Android Studio to generate the signed APK with a valid signature?
When I inspect the APK using jarsigner, from the Java 1.8 release, I get the message:
jar is unsigned. (signatures missing or not parsable)
If I use jarsigner to sign the app, it then installs on most devices but not on my device running Android 4.1. The command I used is:
jarsigner -verbose -keystore "...path...\perinote-release.keystore" app-release.apk perinote Further, if I add to the jarsigner options:
-digestalg SHA1 -sigalg MD5withRSA
it is accepted by the Android 4.1 device. I found these options in another post, no manifest. jar is unsigned. (signatures missing or not parsable), indicating that there was, at some point, a change in the encryption from SHA1 to SHA2.
Here is my build.gradle for "app"
apply plugin: 'com.android.application' android { signingConfigs { release { keyAlias 'perinote' storeFile file('...path.../perinote-release.keystore') } } compileSdkVersion 24 buildToolsVersion "25.0.0" compileOptions.encoding = 'UTF-8' defaultConfig { applicationId "com.perinote.camera" minSdkVersion 15 targetSdkVersion 24 renderscriptTargetApi 20 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' signingConfig signingConfigs.release } } lintOptions { checkReleaseBuilds false } } dependencies { compile 'com.android.support:support-v4:24.0.0' testCompile 'junit:junit:4.12' } What can I do to configure Android Studio to use SHA1 so that my app(s) will continue to work on Android 4.1 devices? Or is there something else I should be doing?
EDIT: I realize I should switch to SHA256. But I still need a way for my app to run on Android 4.1. Do I need to generate two versions and publish both of them?