radarlabs / react-native-radar

React Native module for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
170 stars 32 forks source link

IOS Build failure in relation with OCMock #80

Closed andersonqi closed 5 years ago

andersonqi commented 5 years ago

Describe the bug I get the following error in IOS. 'OCMock/OCMock.h' file not found Following the documentation.

To Reproduce Steps to reproduce the behavior:

  1. npm install react-native-radar
  2. react-native link react-native-radar
  3. Add key to plist
  4. Add pod 'RadarSDK', '~> 2.1.0'
  5. Add CoreLocation

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Metadata (please complete the following information):

Additional context Add any other context about the problem here.

jimjeffers commented 5 years ago

I'm having this issue as well.

jimjeffers commented 5 years ago

I solved this by removing the test target and linked frameworks inside of the workspace. First remove the test target by selecting it and hitting the minus button:

Screen Shot 2019-06-19 at 9 55 22 AM

Then look inside of the frameworks folder for the RNRadar project:

Screen Shot 2019-06-19 at 9 58 08 AM

By removing the test target OCMock will no longer attempt to compile. And by removing the frameworks linked inside of the project, which are not present unless you install them internally via Carthage, the library will use the CocoaPods installed frameworks.

The library author should be able to resolve this hangup pretty easily. Hopefully they can get a small update out. Until then you may have to do this manually as I have.

russellcullen commented 5 years ago

Thanks for the report and the workaround @jimjeffers !

We'd happily take a look at a pull request if you have a quick fix handy, keep in mind we can't simply remove the test target completely from the project as we need to run tests.

We're actively working on a solution and apologize for the inconvenience here, will keep this issue open until a fix is released.

andersonqi commented 5 years ago

@jimjeffers I used the same way to solve it at the time. Thanks for the help

jimjeffers commented 5 years ago

@russellcullen that makes sense. I do not have a PR as I've never made my own RN package for distribution. But I can say looking at all of the other dependent libs in the project... none of them include any native test code. So there must be an alternative way to handle this. My guess is you want to create a build script that removes the linked frameworks and the test/test targets from the release build. Wish I had a solution to have the best of both worlds. For now you may just want to update the readme w/ a few extra steps for iOS.