简体   繁体   中英

Loading native C library from Objective-C in Flutter plugin

I have a native C library (.so) build in versions for android and iOS. I want them to be used in a flutter app I am building. For android I use System.loadLibrary() in Java to load the file (wrapped in JNI ) and it is included via the Gradle build system/CMake . But how do I get the same for iOS in objective C ?

Seems like I can use dlopen() on the library and then dlsym() every single function to get their symbol into the app at runtime. Seems pretty dump but I guess it could work (when I at some point have convinced the buildsystem to include the lib into the actual package it builds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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