-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using cocoapods without react native link #239
Comments
Hi @hccoelho,
And after link script has finished all of your dependencies will be in a Pods folder. Also AppDelegate.m is also modified automatically to register AppCenter modules. Could you please describe your integration process to find out what went wrong? Best, |
Hi @bmourat, thanks for the quick response. The behavior you described works here when doing "react-native link" however because it links projects into the "Libraries" folder, it introduces a compilation dependency to RN which, after several hours, I could not figure how to solve it. Even when I added the whole RN projects to the Libraries folder 😭 If I do "react-native link" the following structure is set into XCode: Pod file: The appcenter native pod libraries are added to the podfile as you describe above but the reactnative code is added via project reference into the "Libraries" folder. That's where my problem starts 😞 . Here's the error I see when I try to run the project: What I'm proposing is change the behavior of the "react-native link" to add all the references through cocoapods. Something like: Pod file: Note that adding only the RN cocoapods will bring the native cocoapods necessary since they are set as dependencies in the spec. With this approach, I had no compilation issue, and to me feels a bit better since it avoids my project from managing the external code. Hope this clarifies. Thanks for helping. |
Thanks @hccoelho |
Hmm before I haven't used "react-native link" much, always used pod dependencies since it feels really easy to maintain. As for my podfile here's what it looks like:
Thoughts? |
@bmourat did you have the chance to see my last post? |
Hey @hccoelho Sorry for the late response, but we are still discussing this feature. Best, |
thanks |
Hi AppCenter community,
I've been trying to move away from HA/CodePush and finally migrate to appcenter but I've been facing some challenges since my IOS project has been set up to integrate with cocoapods for all RN libraries I consume (including RN).
Basically, my problem is that "react-native link" links the appcenter* projects into the project "Libraries folder" however, this way the compiler has a hard time finding the React Native modules since they are set via cocoapods. I tried to setup all the appcenter* packages via cocoapods but, trying leveraging the current podspecs, was not working since they have an issue with the "s.source_files" field value.
With that said, I found a good integration approach where I can leverage completely the cocoapods.
My pod file looks like this:
...
pod 'appcenter', path: '../node_modules/appcenter/ios'
pod 'appcenter-analytics', path: '../node_modules/appcenter-analytics/ios'
pod 'appcenter-crashes', path: '../node_modules/appcenter-crashes/ios'
pod 'appcenter-push', path: '../node_modules/appcenter-push/ios'
...
However for this to work I had to change the podspecs and references in the code as shown here: https://github.com/hccoelho/AppCenter-SDK-React-Native/commit/f290b767c65f95d4f14bfa9dd026aa8cbffc792d
I tested everything locally and it works great, however, I could not find a good way to point my package.json dependencies to subfolders of the repo. Something like this would not work with npm/yarn 😞 :
"appcenter": "git+https://github.com/hccoelho/AppCenter-SDK-React-Native/*tree/develop/appcenter*#f290b767c65f95d4f14bfa9dd026aa8cbffc792d",
(you get the idea for the rest of the packages)
I would like to get your thoughts on couple things:
Disclaimer: I'm not an expert in XCode either cocoapods, however, I kinda like that everything is set via cocoapods since it feels way easier to maintain.
My env:
Thank you in advance.
The text was updated successfully, but these errors were encountered: