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 failing when linking through pods (fails to compile the RNRadar test files) #67

Closed noahtallen closed 5 years ago

noahtallen commented 5 years ago

Describe the bug I switched to linking react-native-radar through pods:

...
pod 'react-native-radar', :path => '../node_modules/react-native-radar'
...

I'm unsure if switching back to linking manually will fix this issue, but I'll try that next.

After a pod install (and a pod update for some other things), the build is failing. It says: XCTest/XCTest.h file not found. I can fix this error by adding s.framework="XCTest" to the bottom of the react-native-radar.podspec file. (And running pod install again after that.) However, once I fix that, I get a new error: 'OCMock/OCMock.h' file not found. These both happen in the same file:

react-native-radar/Carthage/Checkouts/ocmock/Examples/iOS9Example/iOS9ExampleTests/iOS9ExampleTests.m

For some reason, it is trying to build the RNRadar Xcode tests when I try to a development build for my own app. And, for some reason, the ocmock dependency includes a ton of old "example" projects which are getting compiled while building my own app. 🤔Any clues?

To Reproduce Link the library through pods, run pod install, and try to compile.

Expected behavior The build should work, and it shouldn't build old example projects for third party dependencies.

Metadata (please complete the following information):

russellcullen commented 5 years ago

Thanks for the report, this is definitely an issue and we're working to resolve this asap. We've published tests and supporting frameworks to npm, but running these shouldn't be required (or necessary) for consumers.

We'll update this thread when a fix goes out (soon).

russellcullen commented 5 years ago

@noahtallen - it looks like this is simply an issue with our podspec, does changing the "source files" line to:

s.source_files = "ios/*.{h,m}"

fix your issue? We'll be pushing this fix in our next release.

russellcullen commented 5 years ago

Fixed in https://github.com/radarlabs/react-native-radar/releases/tag/2.1.6 - let us know if you have any problems after upgrading. Always happy to help.

noahtallen commented 5 years ago

The build works now! Thanks so much for the quick response.