拆分后APK我应该选择哪一个?

时间:2018-04-23 07:53:48

标签: android google-play apk

我拆分我的apk应用程序,我得到了多个apk

现在我选择将哪一个导入我的游戏商店?

5 个答案:

答案 0 :(得分:2)

您添加了所有这些内容,Play Store会为用户选择正确的内容,具体取决于他们的设备。请务必为每个apk使用不同的版本代码。

有关详细信息,请参阅official documentation

答案 1 :(得分:1)

是的,这取决于您要定位的设备。有关更多信息,请访问以下 - stackoverflow和开发人员的官方链接也对您有所帮助:

答案 2 :(得分:0)

取决于您要定位的设备。 Play商店会告诉你上传apk后你遗漏了多少设备。如果要上传多个版本,请确保每种风格的版本代码都不同。例如,我有XXXn,其中n是cpu架构的代码。

答案 3 :(得分:0)

您可以让gradle自动配置您的版本代码,然后将所有应用程序上传到Play商店。

下面的google示例将自动附加001,002或003,具体取决于变体('armeabi-v7a':1,x86:2,x86_64:3)。

请注意,您必须将播放商店从最小号码上传到最大号码。

请参阅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
    }
  }
}

有关备用版本代码方案的更多示例,请参阅分配版本代码(https://developer.android.com/google/play/publishing/multiple-apks.html#VersionCodes

答案 4 :(得分:0)

我无法发布多个版本 问题是发布代码或版本

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'

        }
    }