简体   繁体   English

React-Native Android NDK

[英]React-Native android NDK

App middle native Player(C++) build with NDK 13b version and uses libgnustl-shared.so build with it. 应用程序中间本机Player(C ++)使用NDK 13b版本进行构建,并使用libgnustl-shared.so进行构建。 React native uses different version of NDK and libgnustl-shared.so comes with it(NDK 10e version) has conflicting with the one I use for my middleware libs. React native使用了不同版本的NDK和libgnustl-shared.so附带(NDK 10e版本)与我用于中间件库的版本存在冲突。 Is there a way I can resolve this? 有办法解决吗? the lib used for app is not accepted by react-native and react-native based lib is not compatible with my middleware libs. 用于应用程序的lib不被react-native接受,并且基于react-native的lib与我的中间件lib不兼容。 I can not downgrade on the NDK used for my native app (to 10e supported for react-native). 我无法在用于本机应用程序的NDK上降级(react-native支持到10e)。 Any help is appreciated. 任何帮助表示赞赏。

The most correct way would be to refer the same version of library across all of the application. 最正确的方法是在所有应用程序中引用相同版本的库。 But if it is impossible - you may link one module against static version of library while leaving the second one linked against shared as usual. 但是,如果不可能-您可以将一个模块链接到库的静态版本,而将第二个模块链接到照常共享。

But such approach is rather a workaround than a real solution. 但是,这种方法不是真正的解决方案,而是解决方法。 Because there are at least next downsides: 因为至少存在下一个缺点:

  • app size bloates because now you are deploying code for two versions of library instead of one 应用程序大小膨胀,因为现在您要为两个版本的库而不是一个版本部署代码
  • objects of the same classes in different library versions may be binary incompatible - so if you try to pass c++ objects between code that relies on different lib version - it ends up with undefined behavior. 不同库版本中相同类的对象可能是二进制不兼容的-因此,如果尝试在依赖于不同lib版本的代码之间传递c ++对象-最终将导致未定义的行为。

At the end: I'd think twice if there is really no way to use the same version everywhere. 最后:如果真的没有办法到处使用相同版本,我会三思而后行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM