Android的JNI:32位兼容64位的设备? [英] Android JNI: 32-bit compatability with 64-bit devices?

查看:1650
本文介绍了Android的JNI:32位兼容64位的设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些使用本机的组件库,这些库与NDK专为32位ARM架构。

I have some libraries that use native components, the libraries are built with NDK for 32 bit Arm architectures.

现在我们有现代化设备的64位处理器,所以我想知道如果库将正常工作。在我的情况,我没有本地库的源$ C ​​$ C文件,只是so文件,我可以不建立他们对64位。

now we have 64-bit processors on modern devices, so I'm wondering if the libraries will work. In my situation, I don't have the source code files of the native library, just the SO files, I can't build them for 64-bits.

于是将32位库在64位处理器上运行?或者我必须重新建立他们?

So will the 32-bits libraries run on 64-bits processors? or I have to re-build them?

**

修改

**
在我的情况我有以下内容:

** In my scenario I have the following:

1 - 我手动分发的APK,并没有发布到谷歌玩呢。

1- I distribute the APK manually, didn't publish to Google Play yet.

2 - 该项目有两个机库,其中一个64安培; 32位的支持,另一只32位。

2- The project has two native libraries, one with 64 & 32-bits support and the other with 32-bits only.

有没有一种方法,使64位设备的应用工作,而无需发布到谷歌玩了吗?我可以删除64位的库,来执行包管理器来加载32位的?

Is there a way to make the application work on 64-bits devices without having to publish to Google Play for now? can I remove the 64-bits libs to enforce the package manger to load the 32-bits ones?

推荐答案

32位的库将工作在64位处理器就好了。

The 32 bits libraries will work just fine on 64 bits processors.

只要在图书馆得到安装了正确的/官方的方式(即不手动下载或从APK一些非标准的部分提取出来,但在APK妥善包装),包管理器将检测过程中采用32位库,并且该过程应在32位模式被启动。如果不是,该过程将在64位模式中启动的,后来将无法加载32位库。 (如果您的APK会包含一些.so文件,但不是全部,在64位模式,它只会安装它们,这个过程将在64位模式推出。所以,除非所有的.so文件可用于特定ABI,不包括任何人)。

As long as the libraries get installed the right/official way (i.e., not manually downloaded or extracted from some nonstandard part in the APK, but packaged properly in the APK), the package manager will detect that the process uses 32 bit libraries, and the process should be started in 32 bit mode. If not, the process will be started in 64 bit mode, and later will be unable to load 32 bit libraries. (If your APK would contain some .so files, but not all, in 64 bit mode, it would only install them, and the process would be launched in 64 bit mode. So unless all .so files are available for a specific ABI, don't include any of them).

所以,如果你有本地库之一的64位版本,只需删除并只船32位版本,直到你有它们的所有64位版本。

So if you have a 64 bit version of one of the native libraries, just remove that and only ship the 32 bit version, until you have 64 bit versions of all of them.

这篇关于Android的JNI:32位兼容64位的设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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