Closed hojberg closed 7 years ago
It seems to me that you've worked to fix those issue, but not release a new version to npm/cocoapods?
cc @BretJohnson
@hojberg The header location changed in 0.40 and we rolled out a fix to handle that several weeks back. So I'm not sure why you are seeing this. What version of the npm components do you have installed currently?
@BretJohnson We're using mobile-center-crashes@0.3.0 which pulled in mobile-center-link-scripts@0.1.6
We're seeing 'RNCrashes/RNCrashes.h' file not found
in our main project, along with 'React/RCTBridgeDelegate.h' file not found
within RNCrashes itself.
(I'm working on the same project as @hojberg.)
I was able to get rid of the first error by re-running react-native link, but 'React/RCTBridgeDelegate.h' file not found
persists.
Adding further confusion; the react-native link command adds RNCrashes to the project and updates AppDelegate.m (and thus the build error mentioned above).
When we tried to manually install RNMobileCenter, we can't find RNCrashes in the SDK zip files and the manual steps docs don't mention it at all.
We're a little confused as to what should/should not work right now with regards to using the crash service with React Native.
[Back to using react-native link approach.]
When I try to build RNCrashes directly within my project (selecting Libraries > RNCrashes, hitting ⌘B), I'm seeing:
'React/RCTBridgeDelegate.h' file not found
within
Pods > Development Pods > React > Core > React > Base > RCTBridge.h
.
Success!
We added an additional Header Search Path to RNCrashes: $(SRCROOT)/../../../ios/Pods/Headers/Public
and now we're able to build and run.
Not sure how to differentiate whether the target project has pulled React in via Cocoapods vs a Library as the former won't resolve without this additional search path.
@barnabyc. I've been looking at this more, trying to understand why you guys are seeing this and reproduce, but I haven't been able.
First, can you confirm that you are building with the .xcworkspace in xcode, not the .xcodeproj file. After adding CocoaPods you need to switch to using the workspace it creates.
Also, who are you seeing that imports RCTBridgeDelegate.h? RNCrashes and RNAnalytics never #import that directly; it only should be other React files themselves that import it.
If you create a new project with react-native init and add Mobile Center to it, do you see the same issues? That can be a useful comparison sometimes. But again, that works OK for me with RN 0.42.2.
As for the steps to use the framework ZIPs directly, not using CocoaPods: MobileCenter and RNMobileCenter (the core functionality) are the only thing in CocoaPods / framework zips. RNCrashes itself always comes from npm, node_modules/mobile-center-crashes/ios/RNCrashes.xcodeproj
, added by the react-native-link. That's why you didn't see it in the zip.
Finally, if you're willing, would you mind inviting the MobileCenterBuildSupport github user, granting read access to your repo. That would allow me to play with your source repo itself to help troubleshoot. And you can of course remove access when done troubleshooting. That can make it easier to get to the bottom of this, but if you'd rather not do it, that's OK too.
In any case, I would like to understand better exactly why you guys ran into this. And please keep the Mobile Center feedback coming, with any other issues / suggestions. Also feel free to use the Intercom link (button right support button) in the website to chat with us, especially for suggestions or non-SDK issues.
@BretJohnson Thanks for the thoughtful reply.
Our project includes React via CocoaPods, not npm, prior to introducing MobileCenter. Because of that, the default header search path in RNCrashes could not locate the RCTBridge headers.
We added: $(SRCROOT)/../../../ios/Pods/Headers/Public
(in addition to the existing $(SRCROOT)/../../react-native/React
). As soon as we added that, everything compiled.
I left a lot of noisey feedback in this thread so may have inadvertently lost that detail.
@barnabyc Why do you guys include React via CocoaPods, not npm? That seems like a pretty nonstandard configuration, but maybe you guys have special needs here. I would like to understand it better though. Thanks.
Closing. @barnabyck, @hojberg, and team - please feel free to ping us if you still have any problems here. For feedback, writing up another GitHub issue is fine or you can also ping us on Intercom inside of Mobile Center (the Conversations bubble in the bottom right after you log in) just mention my name & we can chat some there.
@BretJohnson - thanks for closing this out now that we're unblocked.
I don't think we had any particular reason for using React via CocoaPods vs npm other than that was the iOS package manager we were using elsewhere, and as React was available and working well, we had no need to use npm. If an additional search path is simple to include, would it be feasible to add it to future versions of the MC SDK? Just in case anyone else is non-standard CocoaPods like us.
Definitely will use Intercom, already had a good discussion there regarding code-push and JS source maps support for crash symbols.
@barnabyc Do you think you can share the steps to create a new React Native app, using CocoaPods, that demonstrates this problem. I just want to make sure I understand the exact scenario. Thanks.
I get a missing header error when running on React Native 0.42.
I believe 0.41 introduced a new location for the headers - Has
mobile-center-crashes
not been updated for that?