-
Notifications
You must be signed in to change notification settings - Fork 606
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
Doesn't work with use_frameworks! / Include of non-modular header #1285
Comments
@radex do you have any context on this? |
As a workaround, I run a ruby script that modifies the .podspec file of this library, changing the public headers from
to
This ruby script is ran before doing pod install. Afterwards, proper public headers are exposed for a successful build. |
@johnmikel Thank you! Will try and report back. I'm currently trying to remove |
Removing use_frameworks works for us! use_modular_headers for independent dependencies wherever use_frameworks is needed |
This worked for me as well. Thanks! |
Yes, it will resolved this error for module, but then Xcode app build gives KeyChainHelper not in scope error. can you suggest any solution for this? |
I know it's been a while but can you add some context for your solution to this thread? (A code example, perhaps?) I'm running into the exact same issue and I'm sure others are as well. Thanks! |
Is there a way to make WatermelonDB work with use_frameworks? I also have react-native-firebase for messaging in my app and it requires use_frameworks. See https://rnfirebase.io/#altering-cocoapods-to-use-frameworks My preferred setup would be to use use_frameworks! :linkage => :static but then I get errors in iOS build for WatermelonDB. |
Update: The preferred, less complicated fix is now @johnf's below. Note that if you're using RN 0.71+, you'll also need to be on at least Watermelon v0.25.1+, in order to also fix #1469 . = = = original post for nostalgia = = = There's a way to get this all working with react-native-firebase and
To save yourself the trouble of reapplying this patch every time manually, consider using something like patch-package, which will automatically apply this patch for you every time.
|
@fivecar I tried following your steps but i keep running into: |
Sorry to hear that, @KrisLau . I unfortunately don't have any insight into what's causing your specific error. I can only report what worked for me — and it took hours to get it working, and I still don't fully have confidence it'll hold together. |
@fivecar Makes sense that really blows but I appreciate you taking the time to get back to me, I'll comment over here if I manage to figure something out! |
Ok so for anyone who might find themselves in a similar position, the difference for me is that I had an Expo workaround applied too so for the
Then I had to do step 1 & 2 only from the comment that @fivecar linked before: Re run Cleaned the pod cache using |
@radex you should take a look to this one if you find some times, I know there is a lot of work in other issues, but this one could block developers at installation step. |
Doesn't the all solutions here involves in modifing the node_packages? All issues are closed but does something prevents a PR? |
This solution worked for me react-native-maps/react-native-maps#3597 (comment) $static_framework = [
'WatermelonDB',
'simdjson',
]
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library # >= 1.9
end
end
end
end |
@Dallas62 @KrisLau Can you confirm that @johnf's solution works for you? I'm not sure that putting everything in public_header_files is actually the correct solution to enabling 🍉 to work with use_frameworks (BTW: If you can, I highly recommend that you DO NOT use use_frameworks - in most cases, it's unnecessary and detrimental to startup performance) |
Unfortunately, rnfirebase doesn't allow us to remove use_frameworks. For the For the solution of @johnf, I not a big fan since it's a workaround to make every things work together. It doesn't work without this step in the Podfile. |
@radex I'll give it a test whenever I finish up my current feature and will update here. However, it seems more like a workaround. Would it not be better to have WatermelonDB work both with and without |
Yes, of course. I'm all for making 🍉 work with |
@radex Makes sense! I'm not quite sure what a permanent fix would be then since I have no experience with podspec files. If there are any ideas you or anyone else in the thread might have, I will try to test them out on my personal files and see if anything sticks. I'll also look into some ideas on my own |
@johnf's fix works for me as well, and I verified by backing out my recommended changes, deleting I've edited my original comment above to now recommend @johnf's fix instead. Thank you all! |
Hi @radex, Copy and paste |
@Dallas62 can you show your Podfile? Also, which RN version? |
RN v0.70.6 |
Also got an issue, even with a full clean of cache,
In the previous version, didn't see difference on |
Okay, I can reproduce the simdjson issue |
@fivecar @KrisLau @Dallas62 @johnf Hi, check out 0.26.0-2 prerelease. Two extra steps need to be done:
I tested on this demo project (RN 0.71) to confirm that it really works: https://github.com/radex/WatermelonDB_tester Before I checked on 🍉's internal project where due to different project structure the simdjson issue didn't occur |
Hi @radex, Thanks for your quick feedback ! Only the import which is failling now : #1285 (comment) |
Found the issue, since it's a dependency from github, the library isn't builded. |
@Dallas62 Hmm, you put GitHub path in package.json? If you used |
Sorry for the late response, I was trying to make a logical commit before testing! I'm on RN 0.70.6 because 0.71 has compatibility issues with some other packages in my project. Tested on iOS (testing Android later cause build time is crazy) and it works great however it seems like I'm getting a bunch of new errors whenever I close and relaunch the app:
I need to do a full pull of all records related to the user every time they reopen the app just in case there's any unsynced data that may have gotten missed. I also do the same thing when the user is added to a new team to sync up all data for that new team (which would be before the |
@KrisLau I’ll fix it, but it’s just a warning and it’s safe to ignore. I just want to know if this version compiled without workarounds in the use_frameworks. If you use an older RN version and/or Expo, that’s even better. And if some workarounds are still needed, let me know which ones |
@radex I do use Expo (bare workflow) and the new update does not seem to break any of the expo packages I use:
I didn't need any other workarounds but I didn't delete the Bridging Header, just cleared the text leaving just the comment. Also, to match the other line that WatermelonDB uses in the Podfile from the original installation steps I used
Not sure if it matters at all but just thought i'd mention it in case. Almost forgot to mention but I had changes I made for
It also doesn't work with the new architecture yet.. Might be worth adding that to the documentation as a warning for anyone using
Okie sounds good! It would be nice to be able to turn it off since it logs hundreds of those warnings for me since it is logging it for individual records haha. Using Thanks for the awesome work again, I really enjoy the package! |
@radex Updated my comment above with more info on my environment and setup. Also just tested Android and it seems to be working but I'm not sure why the warning:
only shows up for Android. The writer and readers are running fine tho |
Sorry, I had to temporarily revert the fix, because it causes some new issues in some other configurations (possibly related to Expo and interactions with RN66)… Forcing WatermelonDB to build as a static library as per #1285 (comment) is currently the official/recommended way of dealing with this issue :) I do have another idea for a much more reliable, long-term fix, but it will take me more time to develop. |
Hey guys I've forked @morrowdigital/watermelondb-expo-plugin and added support for useFrameworks by adding @johnf solution, which @radex stated as currently recommended fix. Disclaimer: |
@rafaellupo wow, thanks so much. I'm still on Managed Expo and I've just been reading through this thread starting to fret reverting to bare. I installed your plugin and swapped it out in my app.js and it worked like a charm. Appreciate you making that 👍 |
@johnf Thanks for the solution and linking to the source of it! Literally spent tens of hours trying to figure it out, your solution is what ended up working for me. |
Hey, can y'all try out the latest |
@radex Can do! Would we still need to force WatermelonDB to build as a static library as per #1285 (comment)? |
@KrisLau No. You can if you want to, but it should work perfectly fine as a dynamic framework |
@radex Tested it without the static workaround and it seems to work great! |
Facing error while setting up in iOS.
Tried,
-> Allow Non-Modular includes in Framework Module to Yes
Versions
Error
Podfile
Error Log
The text was updated successfully, but these errors were encountered: