简体   繁体   中英

after split APK which one should I choose?

I split my apk application and I got multiple apk

now which one I will choose to import to my play store ?

You add all of them, Play Store chooses the right one for the user, depending on their device. Just be sure to use different version codes for every apk.

See official documentation for more information.

Yeah, It depends on which device you want to target . For more information Below - stackoverflow and developer's official links are also be helpful to you:

Depends on which device you want to target. Play store will tell you how much device you have left out after uploading an apk. Make sure you have version code different for each flavor if you want to upload multiple ones. For example,I have XXXn where n is the code for cpu architecture.

you can let gradle auto configure your version code, then upload ALL of the apps to the play store.

google's example below will auto append 001, 002 or 003 depending on the variant ('armeabi-v7a':1, x86:2, x86_64:3).

do note that you will have to upload the play store from the smallest number to the biggest number.

see https://developer.android.com/studio/build/configure-apk-splits.html#configure-APK-versions

android {
  ...
  defaultConfig {
    ...
    versionCode 4
  }
  splits {
    ...
  }
}

// Map for the version code that gives each ABI a value.
ext.abiCodes = ['armeabi-v7a':1, x86:2, x86_64:3]

// For per-density APKs, create a similar map like this:
// ext.densityCodes = ['mdpi': 1, 'hdpi': 2, 'xhdpi': 3]

import com.android.build.OutputFile

// For each APK output variant, override versionCode with a combination of
// ext.abiCodes * 1000 + variant.versionCode. In this example, variant.versionCode
// is equal to defaultConfig.versionCode. If you configure product flavors that
// define their own versionCode, variant.versionCode uses that value instead.
android.applicationVariants.all { variant ->

  // Assigns a different version code for each output APK
  // other than the universal APK.
  variant.outputs.each { output ->

    // Stores the value of ext.abiCodes that is associated with the ABI for this variant.
    def baseAbiVersionCode =
            // Determines the ABI for this variant and returns the mapped value.
            project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))

    // Because abiCodes.get() returns null for ABIs that are not mapped by ext.abiCodes,
    // the following code does not override the version code for universal APKs.
    // However, because we want universal APKs to have the lowest version code,
    // this outcome is desirable.
    if (baseAbiVersionCode != null) {

      // Assigns the new version code to versionCodeOverride, which changes the version code
      // for only the output APK, not for the variant itself. Skipping this step simply
      // causes Gradle to use the value of variant.versionCode for the APK.
      output.versionCodeOverride =
              baseAbiVersionCode * 1000 + variant.versionCode
    }
  }
}

For more examples of alternate version code schemes, see Assigning version codes ( https://developer.android.com/google/play/publishing/multiple-apks.html#VersionCodes )

I can't publish multiple release the problem is the release code or version

ext.abiCodes = ['x86_64':1,'x86':2,'armeabi':3,'armeabi-v7a':4,'arm64-v8a':5,'mips':6]

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.book.walid.resumephilosophie"
        minSdkVersion 15
        resConfigs "ar"
        targetSdkVersion 27
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    splits {
        abi{
            enable true
            reset()
            include 'x86_64','x86','armeabi','armeabi-v7a','arm64-v8a','mips'
            universalApk false
        }

    }
    android.applicationVariants.all { variant ->
        def baseAbiVersionCode =
                project.ext.abiCodes.get(com.android.build.OutputFile.ABI)
        if (baseAbiVersionCode != null) {

            output.versionCodeOverride =
                    baseAbiVersionCode * 1000 + variant.versionCode
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM