【问题标题】:Android can not added apllication to google store APKs or App Bundles are available to 64-bit devices but they only have 32-bit native codeAndroid 无法将应用程序添加到谷歌商店 APP 或 App Bundle 可用于 64 位设备,但它们只有 32 位本机代码
【发布时间】:2020-05-03 12:13:59
【问题描述】:

当我尝试将应用程序放入谷歌商店时,我看到了这个:

此版本不符合 Google Play 64 位要求

以下 APK 或 App Bundle 可用于 64 位设备,但它们只有 32 位本机代码。我只有 32 位本机代码,我在 build gradle 上执行此操作:

从 2019 年 8 月 1 日起,所有版本都必须符合 Google Play 64 位要求。

在您的应用中包含 64 位和 32 位本机代码。使用 Android App Bundle 发布格式自动确保每个设备架构只接收它需要的本机代码。这样可以避免增加应用的整体大小。

ndk {
            moduleName "***"
                abiFilters "armeabi", "armeabi-v7a", "x86_64", "mips",'arm64-v8a'
        }



        task nativeLibsToJar(type: Jar, description: 'create a jar archive of the native libs') {
            destinationDir file("$buildDir/native-libs")
            baseName 'native-libs'
            from fileTree(dir: 'libs', include: '**/*.so')
            into 'lib/'
        }

        tasks.withType(JavaCompile) {
            compileTask -> compileTask.dependsOn(nativeLibsToJar)
        }
        splits {
            abi {
                include  "armeabi-v7a", "arm64-v8a"
            }
        }

        applicationVariants.all { variant ->
            variant.outputs.each { output ->
                // For each separate APK per architecture, set a unique version code as described here:
                // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
                def versionCodes = ["armeabi-v7a":1, "arm64-v8a":2]
                def abi = output.getFilter(OutputFile.ABI)
                if (abi != null) {  // null for the universal-debug, universal-release variants
                    output.versionCodeOverride =
                            versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
                }
            }
        }

但我无法在 google store 上添加 apk

编辑

编辑

[![在此处输入图片描述][3]][3]

编辑 [![在此处输入图片描述][4]][4]

【问题讨论】:

  • 不要使用APK上传到play store,使用AAB
  • @Hooman abiFilters "armeabi", "armeabi-v7a", "x86_64", "mips",'arm64-v8a' , 'x64' 这个?
  • @MichaelStoddart 但偷我不能上传 apk
  • 所以改为上传 AAB!

标签: android android-ndk android-build


【解决方案1】:

关于支持 64 位架构的所有信息都在这里

https://inneka.com/programming/android/how-to-include-so-library-in-android-studio-2/

检查您的项目结构并包含如下库..

 project/
├──libs/
|  └── *.jar       <-- if your library has jar files, they go here
├──src/
   └── main/
       ├── AndroidManifest.xml
       ├── java/
       └── jniLibs/ 
           ├── arm64-v8a/                       <-- ARM 64bit
           │   └── yourlib.so
           ├── armeabi-v7a/                     <-- ARM 32bit
           │   └── yourlib.so
           └── x86/                             <-- Intel 32bit
               └── yourlib.so

【讨论】:

  • 我这样做:ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' 但偷我不能把apk放在谷歌商店。我应该改变什么?
  • 基本上检查您的项目结构并包含 64 位的库
  • 梦想家所以我必须删除我在 build.gradle 中所做的一切?
  • 你的项目结构是什么? **.so 文件的位置在哪里?如果您没有看到 64 位文件夹,请检查它们为 64 位创建文件夹并手动复制**。所以文件..并构建您的应用程序
  • 我张贴屏幕哪个结构是正确的?我从 build.gradle ndk ababiFilters 等中删除
猜你喜欢
  • 2020-02-03
  • 2019-12-28
  • 1970-01-01
  • 2020-01-11
  • 2020-03-07
  • 1970-01-01
  • 1970-01-01
  • 2011-12-03
相关资源
最近更新 更多