在Xcode上导入自定义React本机模块的正确方法是什么?

时间:2019-04-30 13:15:04

标签: react-native react-native-ios

我正在为iOS和Android构建自定义RN模块。在其他一些模块之后,我注意到其依赖项从未导入到模块本身,而是始终导入到主应用程序中。例如,对于iOS:

react-native-admob将Google Mobile Ads SDK作为依赖项,但开发人员必须在该应用上添加。

也就是说,我的自定义模块仅建立在Xcode上,因为当我尝试运行react-native run-ios时会收到错误消息:

info In file included from /Users/.../node_modules/react-native-my-module/ios/MyModuleViewManager.m:2:
/Users/.../node_modules/react-native-my-module/ios/RNMyModule.h:8:9: fatal error: module 'PrebidMobile' not found
@import PrebidMobile;
 ~~~~~~~^~~~~~~~~~~~

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening myapp.xcworkspace

我该怎么办,react-native命令无法从 Link Binary With Libraries 中找到 import 库?

0 个答案:

没有答案