无法在我的项目中生成 x64 版本的 apk [英] Can't generate x64 version of apks in my project

查看:25
本文介绍了无法在我的项目中生成 x64 版本的 apk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据将于 8 月生效的新 Play 商店政策 * 我需要确保我的应用不仅提供 32 位版本,还提供 64 位版本,但是当我尝试生成该版本时通过 NDK,我总是得到相同的库.经过反复尝试,我刚刚收到一个没有任何lib"文件夹的apk.

According to the new Play Store policy * that will take effect in August * I need to ensure that my app provides not only the 32-bit version, but also a 64-bit version, but when I try to generate that version through NDK, I always get the same libs. After trying and trying and trying, I just received an apk without any kind of "lib" folder.

我尝试在 gradle 上使用 abiFilters 设置 NDK,但没有任何更改...

I've tried to set NDK with abiFilters on gradle and got no changes...

defaultConfig {
    applicationId "com.myproject.supermidia"
    minSdkVersion 17
    targetSdkVersion 26
    versionCode 20192201
    versionName "2.4"
    multiDexEnabled true
    vectorDrawables.useSupportLibrary = true
}

推荐答案

为了为 ARM(和 x86 模拟器)构建,拆分应该看起来像这样.x86_64 可能有点没用,因为 x86_64 模拟器很慢,而且没有我知道的硬件......

In order to build for ARM (and the x86 emulator), the splits should look alike this. x86_64 might be a little useless, because the x86_64 emulator is slow and there is no hardware I'd be aware of ...

android {

    defaultConfig {

        ...
        externalNativeBuild {
            cmake {
                arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_CPP_FEATURES=rtti exceptions"
            }
        }
    }

    externalNativeBuild {
        cmake {
            path file('src/main/cpp/CMakeLists.txt')
        }
    }

    splits {
        abi {
            enable true
            reset()
            include "armeabi-v7a", "arm64-v8a", "x86"
            universalApk true
        }
    }
}

这篇关于无法在我的项目中生成 x64 版本的 apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆