如何检查 react-native 库的 64 位兼容性 [英] How to check react-native libraries for 64 bit compatibility

查看:53
本文介绍了如何检查 react-native 库的 64 位兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将我的 react-native 项目升级到 0.59.x,以便它可以提供 64 位版本.

I have upgraded my react-native project to 0.59.x so that it may provide a 64 bit version.

我现在需要检查我使用的每个库是否都提供 64 位版本,例如 react-native-firebase 或其他各种流行的库.

I now need to check whether each library I use provides a 64 bit version, such as react-native-firebase or various other popular libraries.

我已经解压了 APK 并观察到 ​​x86_64 包含与 x86 目录中同名的文件.我担心的是,因为我的升级路径非常复杂且充满问题/黑客,而且我使用的是非常 旧的库,这些库似乎不太可能有 64 位版本,因此 x86_64 中的一些库可能目录实际上可能是 32 位的.

I've already decompressed the APK and observed that x86_64 contains files with the same names as in the x86 directory. My concern is that because my upgrade path was so complex and fraught with issues/hacks, and I'm using very old libraries which seem less likely to have 64bit versions, that perhaps some of those libraries within x86_64 directory might actually be 32 bit.

我觉得必须有某种方式,例如以某种方式检查目录中的 .so 文件.

I feel like there must be some way, such as inspecting the .so files within the directory some way.

注意:

  • 我知道只有提供本机代码的库才需要提供 64 位版本.
  • 我认为 React Native 0.59.x 并不能以某种方式保证我的库也编译为 64 位.我认为由我来找到每个库的版本,它也提供 64 位版本.如果这不是真的,并且简单地升级到 0.59.x 确实 以某种方式保证我的库编译为 64 位,然后告诉我,我的整个问题本身就解决了.不过,这似乎极不可能.
  • 我的偏执源于使用 OLD react 本机库,然后使用 这个 hack 在构建期间绕过版本不匹配问题.
  • I understand that only libraries which provide native code will need to provide 64 bit version.
  • I assume React Native 0.59.x does not somehow guarantee my libraries are compiled to 64 bit also. I assume it's up to me to find a version of each library which also provides 64 bit version. If this is not true, and simply upgrading to 0.59.x does somehow guarantee my libraries are compiled to 64 bit, then tell me that and my entire question itself is solved. This seems extremely unlikely though.
  • My paranoia stems from using OLD react native libraries and then using this hack to bypass version mismatch issues during build.

推荐答案

看看这个 issue,阅读讨论,根据这个,如果你的任何库不是 64 位兼容的,它就不会被编译成 64 位.并且构建不会发生!如果你有这样的问题.然后你可以检测哪个库兼容或不兼容!

Check out this issue, read the discussions, according to this if your any library is not 64 bit compatible it won't be compiled into 64 bit. And build won't be happening! If you have that kind of problem. Then you can detect which library is compatible or not!

另外一种方式,你可以通过ABI设置true来进行拆分 def enableSeparateBuildPerCPUArchitecture = true

In another way, you can do the split by ABI setting true def enableSeparateBuildPerCPUArchitecture = true

制作 64 位版本的 apk 并在 64 位版本的手机或模拟器上查看.

Produce the 64-bit version apks and check it out on 64 -bit version phone or emulator.

这篇关于如何检查 react-native 库的 64 位兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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