Skip to content
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

iOS Device Version #15

Open
Bilal-Abdeen opened this issue Oct 8, 2022 · 9 comments
Open

iOS Device Version #15

Bilal-Abdeen opened this issue Oct 8, 2022 · 9 comments

Comments

@Bilal-Abdeen
Copy link

I am trying to find a way to get flipper to work along with Firebase, which seems to require use_frameworks. I thought of using this excellent demo installation as a reference point.

However, I could not get far. Pods were installed fine. However, building the app threw the following error message. I tried it on the following simulators iPhone 8 iOS 15.0, iPhone 13 iOS 15.0 & iPhone 13 iOS 15.2.

You can’t open the application “rnfbdemo.app” because this application is not supported on this Mac
@mikehardy
Copy link
Owner

Flipper does not work with use_frameworks, it simply does not - follow here: facebook/flipper#3861

You don't provide enough information to troubleshoot (https://stackoverflow.com/help/how-to-ask) but I run this script on M1 macs, and x86-64 macs frequently, it has no problems I am aware of. It worked with iOS15 and works with iOS16 now.

I suspect there is something unexpected in your local environment. Perhaps you are on an M1 mac and you've done some pods using Rosetta2 or something? Can't be sure because of lack of detail, sorry.

@Bilal-Abdeen
Copy link
Author

Bilal-Abdeen commented Oct 8, 2022

I am grateful you clarified that Flipper does not work with use_frameworks! I understood from https://rnfirebase.io/#altering-cocoapods-to-use-frameworks that it does! Do you know if there is any tool, which can simply provide the output of console.log() statements?! I am using Reanimated v2, which takes browsers out, and React-Native-Firebase, which uses use_framewoks, which takes Flipper out. What other options are available?! I highly appreciate your feedback.

The following note, which is on the URL above, is really confusing to me. It starts by saying "use_frameworks is not compatible with Flipper". Then, it says a fix was put in place. I am unsure if the fix does NOT work, or if the "fix" is actually a conditional fix.

"Note use_frameworks is not compatible with Flipper. A fix was put in place in react-native release 0.69.1 that makes it work with and without Hermes. To use it with Hermes make sure you have set static linkage with use_frameworks! :linkage => :static. To use without Flipper, comment out the :flipper_configuration line in your Podfile. Community support to help fix use_frameworks support for New Architecture is welcome!"

@mikehardy
Copy link
Owner

I'm not sure how you could have gotten that impression from the link you actually reference which includes this text:

Note use_frameworks is not compatible with Flipper

That's pretty clear 😆 - then there is further instruction how to disable it.

You are correct that in general JS Debugging Interface is going out, and Flipper is out because of use_frameworks until facebook has time to work through header issues.

I use console logging personally 🤷 - it works for me, they show up in metro, do they no longer show up with reanimated v2? Even if not they should show up in adb logcat on Android or Console.app for iOS, and if you tag your messages appropriately so that you can filter well that seems like as good of an information conduit at runtime as any?

@Bilal-Abdeen
Copy link
Author

I realised that my confusion needed clarification. It seems that I was updating my comment while you were sending your reply! Please, check my comment above, again. Sorry!

  1. You said "That's pretty clear 😆 - then there is further instruction how to disable it."
    Do you mean that what is meant in the note by "A fix was put in place...." is actually how to disable Flipper (and NOT how to make it work)?!

  2. The output of console.log() appears on Metro, but it is not very friendly, e.g. the contents of objects need to be stringified (rather displayed in a nice tree structure).

  3. I am not sure what console.app is. I will look it up. Thanks for the hint.

  4. What I was trying to say about Reanimated v2 is that it does NOT support remote debugging. So, I cannot use Google Chrome (or any other browser) to check the output of console.log() - because I am using Reanimated v2!

@mikehardy
Copy link
Owner

Ah, the mentioned fix is for Hermes. It did not used to work either. That could use clarification.
Flipper does not work, you must disable it.

Yeah, I can type JSON.stringify(thing, null, 2); in my sleep now ;-)

Console.app is the built in macOS console, if you want to see device logs. javascript console goes there as well. It is unbelievably noisy. I am a tolerant person and I find it unbelievably noisy. You might like to do a log filter on command line instead like is in the iOS stance of the e2e test in react-native-firebase workflows. A compact formatted terminal log using xcrun if I recall correctly

Ok: for reanimated v2, I suppose it does direct synchronous things (like react-native-device-info will do, if you use the NNNSync calls) - that kills the javascript debugger interface yes.

Hopefully facebook will fix Flipper soon for all the people used to it but I've been doing react-native so long I got used to just doing console.log before flipper existed, and I just kept doing it 🤷 works okay

@mikehardy
Copy link
Owner

Try this wording here, see what you think: invertase/react-native-firebase#6597

@Bilal-Abdeen
Copy link
Author

Try this wording here, see what you think: invertase/react-native-firebase#6597

This wording looks far better than the previous one. I would suggest the following:

Notes: React-Native-Firebase uses use_frameworks, which has compatibility issues with Flipper, Hermes & Fabric.

  1. Flipper: use_frameworks is not compatible with Flipper. You need to disable Flipper by commenting out the :flipper_configuration line in your Podfile.

  2. Hermes: a fix was put in place in react-native release 0.69.1 that allows Hermes to work with use_frameworks!. To use use_frameworks with Hermes, make sure you have set static linkage with use_frameworks! :linkage => :static.

  3. New Architecture: Fabric is not compatible with use_frameworks!. Community support to help fix use_frameworks support for New Architecture is welcome!

@Bilal-Abdeen
Copy link
Author

I use Flipper as a replacement for an internet browser that displays console.log() statements. I have not, yet, discovered any added value of this tool, other than that it provides a built-in timestamp for each statement.

However, the output of console.log(someObject) on an intent browser or Flipper is a nice object name, which I can click on to see a tree structure for the object.

On Metro, the output of console.log(someObject) is simply the word [object object] (or something like this.) Using stringify is useful. However, the "whole" object is rendered on the Metro screen. I don't have the capability to display/hide parts of the object unless the console.log() statement is executed again.

The minimal interactivity (in displaying JS/JSON objects) on the console of an internet browser or Flipper is what I am missing on the Metro log console :-(

@mikehardy
Copy link
Owner

I understand the desire but don't have the available time to fix Flipper (and New Architecture). Hopefully someone will...

This looks pretty good now - I'm going to go with it - with the numbers before the component headings the rendering wasn't right so I removed them https://react-native-firebase-3kasvg8au-invertase.vercel.app/#altering-cocoapods-to-use-frameworks - thanks for the help

mikehardy added a commit to invertase/react-native-firebase that referenced this issue Oct 9, 2022
…nd which do not (#6597)

* docs(ios, use_frameworks): clarify which parts of react-native work and which do not

Came up in mikehardy/rnfbdemo#15

* Update docs/index.md

Suggestion from @Bilal-Abdeen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants