3

i am having issue with multiple split abi upload to google play and i already tried the solutions to previous questions but they did little to no good to me.

below is my build.gradle config:

apply plugin: 'com.android.application'

android {
//    compileSdkVersion 24
//    buildToolsVersion '24.0.3'
    signingConfigs {
        config {
            keyAlias 'unikey'
            keyPassword '*****'
            storeFile file('E:/Projects/CompanyDroid/AppSigner/mykey.jks')
            storePassword '*****'
        }
    }
    compileSdkVersion 27
    //buildToolsVersion '23.0.1'
    defaultConfig {
        applicationId "com.aethtech.myapp"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 3
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.config
    }
    splits {
        abi {

            // Enables building multiple APKs per ABI.
            enable true

            // By default all ABIs are included, so use reset() and include to specify that we only
            // want APKs for x86, armeabi-v7a, and mips.

            reset()
            include 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'

            // Specifies that we do not want to also generate a universal APK that includes all ABIs.
            universalApk true
        }
    }
    project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9]

    android.applicationVariants.all { variant ->
        variant.outputs.each { output ->
            output.versionCodeOverride =
                    project.ext.versionCodes.get(output.getFilter(
                            com.android.build.OutputFile.ABI), 0) * 10000000 + android.defaultConfig.versionCode
        }
    }
    buildTypes {
        release {
            debuggable false
            jniDebuggable false
            renderscriptDebuggable false
            zipAlignEnabled true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
            versionNameSuffix '1.0'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.android.support:support-v4:23.4.0'
    compile 'com.github.paolorotolo:appintro:4.1.0'
    compile 'com.android.support.test.espresso:espresso-core:2.2.2'
    compile 'com.google.android.gms:play-services-ads:+'
    testCompile 'junit:junit:4.12'
}

the error in google play store looks as below:

enter image description here

another one:

enter image description here

is there something wrong with the version code or abi split, i am new to android studio so i am unable to find any clues to why this is happening.

InsaneCat
  • 2,115
  • 5
  • 21
  • 40
Alok
  • 808
  • 13
  • 40

3 Answers3

0

Change your targetSdkVersion to 26 , Latest targetSdkVersion is 26 and your targetSdkVersion is 27 higher than latest one.

Reference : https://developer.android.com/about/versions/oreo/android-8.0-migration.html

One thing remember every time once you upload release apk on play store always increase the versionCode higher than previous one.

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
     applicationId "com.aethtech.myapp"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 3
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

or check this, Are you using multiple apk in the play store? Or even if you are using one apk but use the splits gradle function, that is considered "multiple" apk to the play store. I think that error can be avoided using a version code scheme like the one described here.https://developer.android.com/google/play/publishing/multiple-apks.html#VersionCodes

Abhishek kumar
  • 4,347
  • 8
  • 29
  • 44
  • still same issue when trying to review, did the changes but no solution :( – Alok Jan 29 '18 at 16:25
  • Create new project on your android studio and compare gradle with that app gradle. – Abhishek kumar Jan 29 '18 at 16:42
  • Please check this one https://stackoverflow.com/questions/42408046/google-play-fully-shadowed-apk – Abhishek kumar Jan 29 '18 at 16:44
  • ok also i tried generating universal apk but its also generating same size as my other abis identical size 3.75 mb that should not be happning as universal abi contains all right? – Alok Jan 29 '18 at 16:48
  • have to checked out that url ? i commented – Abhishek kumar Jan 29 '18 at 16:52
  • i am following version code scheme `project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 5, 'mips64': 6, 'x86': 8, 'x86_64': 9]` check this line do you think this scheme is wrong, i mean as per google the shadow apk must have version higher then other app to resolve issue maybe thats the cause? – Alok Jan 29 '18 at 17:08
  • Why you are using project.ext.versionCodes ?? in your project – Abhishek kumar Jan 29 '18 at 17:14
  • and this https://androidbycode.wordpress.com/2015/06/30/android-ndk-version-code-scheme-for-publishing-apks-per-architecture/ – Alok Jan 29 '18 at 17:29
0

Your gradle file says:

// Specifies that we do not want to also generate a universal APK 
// that includes all ABIs.

But then it has

universalApk true

Is it possible you are uploading a universal APK, and this universal APK is shadowing all your other APKs?

Also from your gradle file I'd expect to see 4 APKs uploaded (one for each native ABI) but you are uploading 2. This looks wrong as well.

Nick Fortescue
  • 13,530
  • 1
  • 31
  • 37
  • no i am not uploading unversal apk, i did make that true just for testing purpose – Alok Jan 29 '18 at 18:38
  • at first i tried uploading all 4 but when i got this issue i deleted the draft from play store and tried uploading and review one by one to see if issue was coming for each apk and it was there – Alok Jan 29 '18 at 18:39
  • 1
    do you actually have any native code in your app? If you don't the APKs will all be more or less identical and shadow each other – Nick Fortescue Jan 30 '18 at 11:46
  • thanks @nick Fortescue that was exactly the issue with my app, coming from xamarin background i didn't noticed that only apps with native libs have diff. architecture requirements – Alok Feb 17 '18 at 03:55
0

You need to Put your Gradle in this Format. (Be Specific ABI Version Code Order)

splits {

        // Configures multiple APKs based on ABI.
        abi {
            // Enables building multiple APKs per ABI.
            enable true
            // By default all ABIs are included, so use reset() and include to specify that we only
            // want APKs for x86 and x86_64.
            // Resets the list of ABIs that Gradle should create APKs for to none.
            reset()
            // Specifies a list of ABIs that Gradle should create APKs for.
            include "x86", "x86_64", "armeabi", "arm64-v8a", "armeabi-v7a", "mips"

            // Specifies that we do not want to also generate a universal APK that includes all ABIs.
            universalApk true
        }
    }
ext.abiCodes = ['x86': 3, 'x86_64': 4, 'armeabi-v7a': 5, 'arm64-v8a': 6, 'armeabi': 1, 'mips': 2]
Nadeem Iqbal
  • 2,357
  • 1
  • 28
  • 43
Harsh Dalwadi
  • 388
  • 7
  • 15