简体   繁体   English

如何开发跨平台应用程序库

[英]How to develop cross platform app library

We currently have the situation that we need to create an Android library (aar) and an iOS Framework.我们目前的情况是需要创建一个Android库(aar)和一个iOS Framework。 You know about the benefits, so we would like to have this done in a cross-platform manner.你知道好处,所以我们希望以跨平台的方式完成。 There is a strong React Native background in our company, but since there is no official solution to achieve this, we would be open for other suggestions as well.我们公司有很强的 React Native 背景,但由于没有官方解决方案来实现这一点,我们也愿意接受其他建议。 I read here that this can be done.在这里读到是可以做到的。 However the mentioned solution has major drawbacks, such as the .framework size in iOS.然而,上述解决方案有很大的缺点,例如 iOS 中的 .framework 大小。 Does anyone have a better approach for this?有没有人对此有更好的方法?

You can view Kotlin/Native for crossplatform libraries.您可以查看平台库的Kotlin/Native

Kotlin/Native supports two-way interoperability with the Native world. Kotlin/Native 支持与 Native 世界的双向互操作性。 On the one hand, the compiler creates:一方面,编译器创建:

  • an executable for many platforms许多平台的可执行文件
  • a static library or dynamic library with C headers for C/C++ projects用于 C/C++ 项目的带有 C 头文件的静态库或动态库
  • an Apple framework for Swift and Objective-C projects用于 Swift 和 Objective-C 项目的 Apple 框架

On the other hand, Kotlin/Native supports interoperability to use existing libraries directly from Kotlin/Native:另一方面,Kotlin/Native 支持直接从 Kotlin/Native 使用现有库的互操作性:

  • static or dynamic C Libraries静态或动态 C 库
  • C, Swift, and Objective-C frameworks C、Swift 和 Objective-C 框架

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

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