-
Notifications
You must be signed in to change notification settings - Fork 607
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
CocoaPods Support #279
Comments
@victorkvarghese not currently, but it should be very easy to do if you'd like to contribute :) |
Im not that well versed in iOs side. i tried adding podspec manually to the folder. pod install worked .. But the app crashes saying [DB] Uh-oh. Database failed to load, we're in big trouble TypeError: Cannot read property 'initialize' of undefined Not sure whether it's a native issue or my JS code. |
Would be nice if WatermelonDB is supporting CocoaPods, react-native is making the default of it. |
Need CocoaPods Support! |
@jaysonjh the idea of open-source is that if you really need something you could provide a PR. :) |
Yep, please do! I just did a quick search and Artsy seems to have made a tutorial on how to set up a CocoaPod: |
I don't know how to setup CocoaPods, but the tutorial looks easy. Maybe I try it this week. :-) Thanks for sharing the tutorial! |
I write this pod file, it can be build.
The pod will auto create the WatermelonDB-umbrella.h include FMDB.h. So must modify the Bridging.h
But in xcodeproject, remove this not build success.May be you can try to fix to integrate by xcodeproject. |
We are currently maintaining a fork with CocoaPods support. Would love to contribute back however the fork has some other adjustments (gradle support etc.) which would make integrating hard atm. Here is the podspec which works for us: https://github.com/dm-Mobile-SE-Developer/WatermelonDB/blob/715ae494ff7956eea9bd7052281d791fd914536b/WatermelonDB.podspec. Currently this is not a priority. We might clean up the branch in the future and make a PR, however If someone needs CP support earlier I'd love to see this happen and would support if needed. |
The podspec needs to be added to the package.json/make.js script so it will be included in the artifact published to npmjs.org. Also we changed the native/ios/WatermelonDB/SupportingFiles/Bridging.h header file to include the FMDB library as a pod, see: dm-Mobile-SE-Developer@979bea0 and dm-Mobile-SE-Developer@02838c0. |
Thanks for the advice @dehlen !
This makes total sense for CocoaPods use, but I don't want to force people to use CocoaPods, since this is not a standard / not completely understandable to many in React Native community… It would be great to maintain compatibility with both. Isn't there a preprocessor macro can_include to select whichever FMDB header is available? |
Something like this might work however this is not tested and i wrote it on my iPhone so i might have some syntax issues I am not seeing :)
|
Btw. I am not sure if this would work but wouldn't it be possible to add |
If __has_include actually works, I'd prefer it that way. Personally, I think messing with header search paths is bad and causes a ton of issues (as many people experience with React Native's search path mess) |
I jumped through many hoops to get this right, but here's the patch I'm currently using that contains a working podspec file. It contains a couple of other fixes, namely importing There are a couple things to consider:
I'm planning on opening a PR eventually, but not sure if the RN 0.59.3 dependency is blocking. Good luck 🤞 |
Why? @stigi This shouldn't be necessary with modern Swift.
It's not :) |
@radex are you referring to using |
@stgi I'm not 100% sure if |
This'd be fantastic to get in now that RN >= 0.60 has autolinking! |
@jakebloom PRs welcome! :) Looks like most of the work is done, just needs to be brought all together |
On RN 0.61.2. Doc's For pods, using @stigi 's gist in #279 (comment), it's close but won't build with 1 error in in So I'm stuck, can't build WatermelonDB at all on iOS. Tried both v0.14.1 and latest v0.15.0-5. |
@fungilation i think the React import lacks a #canImport directive |
That doesn't help, if I don't add the I'm on Xcode 11.1 and macOS Catalina |
@radex eventually you have not added support of cocoapods? :) |
@chelovekdrakon Please contribute! I'm not using CocoaPods for React dependencies at this moment and no one sent a working pull request for adding a Podfile yet |
Same here, were you able to solve it? |
Also struggling to get this to build on RN 0.61.5, anyone managed it? |
search react-native projects for CocoaPods support and you'll see what changes need to be made. React imports need to be slightly different for it to compile |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Hi,
is it possible to integrate this library using Pods?
All of my other libs use Pods.
Would be great to see Pods Support!
The text was updated successfully, but these errors were encountered: