【问题标题】:Google Play 64-bit requirement App bundle failed to updateGoogle Play 64 位要求 App bundle 更新失败
【发布时间】:2020-01-23 14:26:03
【问题描述】:

我们很想像往常一样更新我们的应用程序,但现在谷歌强制要求应用程序与 32 位和 64 位架构兼容。我尝试了不同的解决方案,但在所有情况下,我在屏幕截图中都遇到了这个错误。

这是我最后的解决方案

defaultConfig {
    ...
    ndk {
        abiFilters  "armeabi-v7a", "arm64-v8a"
    }
}

def enableSeparateBuildPerCPUArchitecture = false
splits {
    abi {
        reset()
        enable enableSeparateBuildPerCPUArchitecture
        universalApk false
        include  "armeabi-v7a", "arm64-v8a"
    }
}

我也试过这个ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'

【问题讨论】:

    标签: android 32bit-64bit android-app-bundle


    【解决方案1】:

    设置:

    universalApk true
    

    为了将这两种架构都包含在一个通用 APK(不是 App Bundle)中。包含x86 和/或x86_64 仅对调试版本(模拟器)有用,但它会使带有无用本机程序集的发布版本膨胀。


    但对于 App Bundle,请参阅 The base module build configuration:

    分割块被忽略

    在构建 app bundle 时,Gradle 会忽略 android.splits 块中的属性。如果您想控制您的 app bundle 支持哪些类型的配置 APK,请改用 android.bundle 来禁用配置 APK 的类型。

    默认按abi拆分,但也需要both *.so:

    android {
    
        // When building Android App Bundles, the splits block is ignored.
        splits {...}
    
        // Instead, use the bundle block to control which types of configuration APKs
        // you want your app bundle to support.
        bundle {
            language {
                // Specifies that the app bundle should not support
                // configuration APKs for language resources. These
                // resources are instead packaged with each base and
                // dynamic feature APK.
                enableSplit = false
            }
            density {
                // This property is set to true by default.
                enableSplit = true
            }
            abi {
                // This property is set to true by default.
                enableSplit = true
            }
        }
    }
    

    ndk build 也已弃用,使用 cmake...并确保 arm64-v8a *.so 甚至已构建(可以配置很多,但它最不关心缺少的库,直到它无法链接他们)。从armeabi 加载库不被接受为“64 位支持”(已经尝试过)。

    【讨论】:

    • 感谢@Martin Zeitler 我尝试了上面的解决方案,但仍然无法发布 apk 或捆绑包。使用 bundle 它只显示了游戏控制台 armeabi-v7a 上的一个平台,但是使用 apk 分析器它是 libs arm64-v8a、armeabi-v7a 下的两个文件夹。通过使用 apk,它显示了 2 个平台 arm64-v8a、armeabi-v7a 但仍然无法继续推出 apk。
    【解决方案2】:
    defaultConfig {
        ...
    
        ndk {
            abiFilters "arm64-v8a", "armeabi-v7a"
        }
    
    }
    
    bundle {
            density {
                // Different APKs are generated for devices with different screen densities; true by default.
                enableSplit true
            }
            abi {
                // Different APKs are generated for devices with different CPU architectures; true by default.
                enableSplit true
            }
            language {
                // This is disabled so that the App Bundle does NOT split the APK for each language.
                // We're gonna use the same APK for all languages.
                enableSplit false
            }
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-24
      • 2020-04-07
      • 2019-12-26
      • 2019-12-22
      • 1970-01-01
      • 2020-01-02
      • 2021-01-08
      • 1970-01-01
      相关资源
      最近更新 更多