添加 'ndk { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' }' 后,Android 应用程序不兼容 64 位 [英] Android app not 64 bit compliant after adding 'ndk { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' }'

查看:56
本文介绍了添加 'ndk { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' }' 后,Android 应用程序不兼容 64 位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在遵循谷歌关于如何使 64 位兼容的 android 应用程序的文档之后

按照谷歌文档的默认配置.我还尝试将相同的代码添加到应用程序的 build.gradle(Module:app)并构建了应用程序包,这里是 lib 文件的样子

gradle 不会生成使应用程序兼容 64 位所需的 x86_64 和 arm64-v8a 文件.例如,我尝试了将 abifilters 放置在何处的不同组合,仅将其添加到根 build.gradle,仅将其添加到应用程序的 build.gradle 中,并且在两者上都有 abifilters,但它不会构建 64 位支持库.

该应用程序是用 Java 构建的,我能够通过添加以下内容来构建 64 位应用程序包:

ndk {abiFilters 'arm64-v8a', 'x86_64'}

然后分析了这个包,它没有 lib 文件夹,谷歌开发者控制台警告消失了,但我如何为这种情况构建 64 位和 32 位支持库?

解决方案

你需要 x86_64armb64-v8a .so 支持 64 位的文件.你不能在 Android Studio 中构建它们.这是原生库.您正在使用的库的依赖项必须针对这些处理器架构重新构建.

After following google's documentation about how to make an android app 64 bit compliant here, the android app bundle I've been trying to build still is not 64 bit compliant.

The android studio project contains different modules(apps) that have there own build.gradle file but all apps have a general build.gradle(Module:app) and the build.gradle project level. In the general build.gradle(Module:app) I added the following:

 ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        } 

To the default config as per google documentation. I also tried adding the same code to the app's build.gradle(Module:app) and built the app bundle and here is how the lib files looks like

The gradle doesn't generate the x86_64 and arm64-v8a files that are necessary to make the app 64 bit compliant. I tried different combinations of where to put the abifilters for example, adding it only to the root build.gradle, adding it only to the app's build.gradle and also having the abifilters on both but it will not build the 64 bit support libraries.

The app is built in java and I was able to build a 64 bit app bundle by adding:

ndk {
        abiFilters 'arm64-v8a', 'x86_64'
    }

then analyzed the bundle and it had no lib folder and the google developer console warning was gone but how can I build both 64 bit and 32 bit support libraries for such a scenario?

解决方案

You need x86_64 and armb64-v8a .so files for 64 bit support. You can't build those in Android Studio. This is native libs. The dependencies of the library that you are using must be rebuilt for these processor architectures.

这篇关于添加 'ndk { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' }' 后,Android 应用程序不兼容 64 位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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