簡體   English   中英

拆分后APK我應該選擇哪一個?

[英]after split APK which one should I choose?

我分裂我的apk應用程序,我得到了多個apk

現在我將選擇哪一個進口到我的游戲商店?

您添加了所有這些內容,Play Store會根據用戶的選擇為用戶選擇正確的一個。 請務必為每個apk使用不同的版本代碼。

有關更多信息,請參閱官方文檔

是的,這取決於你想要定位的設備 有關更多信息,請訪問以下 - stackoverflow和開發人員的官方鏈接也對您有所幫助:

取決於您要定位的設備。 Play商店會告訴你上傳apk后你遺漏了多少設備。 如果要上傳多個版本,請確保每種風格的版本代碼都不同。 例如,我有XXXn ,其中n是cpu架構的代碼。

您可以讓gradle自動配置您的版本代碼,然后將所有應用程序上傳到Play商店。

下面的谷歌示例將自動附加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

我無法發布多個版本,問題是發布代碼或版本

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'

        }
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM