简体   繁体   中英

can't find ios framework headers in react native module library

I've included an iOS framework in the xcode project for the React Native module library I'm creating. Everything compiles fine when I build the ios project in the RN library itself, but once I npm install the library into my main RN project, running react-native link <project-name> , and then build in xcode, the included framework headers are not found.

I checked the normal build settings (Header, Framework, and Library search paths) and they all have $(inherited) listed.

Repo for the react native library that is WIP https://github.com/bsy/react-native-pollfish

Download SDK file from here . May be owner removes the SDK from github.

Please add this line in your package.json file.

"rnpm": {
    "ios": {
      "sourceDir": "./ios"
    }
  }

Also, unable to install your plugin with " npm install ".

The solution to this issue was to make sure that both your Xcode subproject and your main Xcode project both point to a relative path to the SDK.

Steps to take:

  1. Open your application's Xcode project.
  2. If you don't have a Frameworks group in your project, create one.
  3. Open ~/Documents/PollfishSDK using Finder.
  4. Drag the pollfish.framework file into the Frameworks group of Xcode's Project Navigator. In the displayed dialog, choose Create groups for any added folders and deselect Copy items into destination group's folder. This references the SDK where you installed it rather than copying the SDK into your app.

For 3rd party framework set the framework search path in the library project-

$(SRCROOT)/../../../ios/Pods/3rd_party_framework_folder_name

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