添加'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' }'

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

问题描述

在遵循了有关如何使Android应用程序兼容64位的Google文档之后此处,我一直尝试构建的android应用程序包仍不兼容64位.

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.

android studio项目包含不同的模块(应用程序),这些模块具有自己的build.gradle文件,但所有应用程序都具有常规的build.gradle(Module:app)和build.gradle项目级别. 在常规的build.gradle(Module:app)中,我添加了以下内容:

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'
        } 

根据Google文档的默认配置. 我还尝试将相同的代码添加到应用程序的build.gradle(Module:app) 并构建了应用程序捆绑包,这就是lib文件的样子

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

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

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.

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

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'
    }

然后分析了该捆绑包,它没有lib文件夹,并且Google开发人员控制台警告消失了,但是如何为这种情况构建64位和32位支持库?

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?

推荐答案

您需要x86_64armb64-v8a .so 文件以获得64位支持.您无法在Android Studio中进行构建.这是本地库. 对于这些处理器体系结构,必须重新构建您正在使用的库的依赖项.

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天全站免登陆