Unable to sign apk “with only the traditional scheme” even after setting 'v2SigningEnabled' as false

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 19:15:04

问题


I updated my android-studio to latest stable version i.e. 'Android Studio 2.3' and also the gradle to 2.3.0.

Now, when I am trying to generate a signed apk of my app's release build, this "extra" thing (Signature versions:) is getting shown in the last step:

I clicked on 'Signature Help' and this page got opened.

I followed the doc and made changes to my build.gradle file like this:

apply plugin: 'com.android.application'

//Put Fabric plugin after Android plugin
apply plugin: 'io.fabric'

android {
    signingConfigs {
        config {
            keyAlias 'xxxxxx'
            keyPassword 'xxxxxx'
            storeFile file('/Users/xxxxx')
            storePassword 'xxxxxx'
            v2SigningEnabled false
        }
    }
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    lintOptions {
        abortOnError false
    }
    defaultConfig {
        applicationId "com.xxxxx.xxx"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
        debug {
            signingConfig signingConfigs.config
        }
    }
    repositories {
        mavenCentral()
        maven {
            url "https://jitpack.io"
        }
        maven { url 'https://maven.fabric.io/public' }
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('com.mikepenz:fastadapter:1.8.2@aar') {
        transitive = true
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.6.6@aar') {
        transitive = true;
    }
    compile 'com.android.support:appcompat-v7:25.0.0'
    compile 'com.android.support:design:25.0.0'
    compile 'com.android.support:cardview-v7:25.0.0'
    compile 'com.android.support:recyclerview-v7:25.0.0'
    compile 'com.google.android.gms:play-services:10.2.0'
    compile 'com.google.android.gms:play-services-location:10.2.0'
    compile 'com.google.firebase:firebase-auth:10.2.0'
    compile 'com.android.support:support-v4:25.0.0'
    compile 'com.google.firebase:firebase-database:10.2.0'
    testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

and tried to generate the signed apk again but still this "extra" thing is getting shown.

What should I do now to sign apk "with only the traditional scheme"?


回答1:


What you see in the top screenshot is the Android Studio wizard for creating a signed APK. What you want is to tick only the V1 (Jar Signature) checkbox. The other checkbox is for the new signing.

The setting you have in your build.gradle file does not affect what the Android Studio wizard shows to you. It only affects a build from the command line. So ticking V1 and then Finish will work just fine.

I do recommend to make your project ready for the new signing though, as it drastically reduces the installation time for your users (You would then tick V1 and V2 signing. V1 would be for backwards compability)




回答2:


Please add

v2SigningEnabled false in your Sign In buil.gradle app File

For More Detail Read Documentation



来源:https://stackoverflow.com/questions/42587750/unable-to-sign-apk-with-only-the-traditional-scheme-even-after-setting-v2sign

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!