facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.37k stars 952 forks source link

[iOS] Flipper is not detecting apps after upgrading to RNv0.72 #5261

Open dusanristic opened 1 year ago

dusanristic commented 1 year ago

After I upgraded my RN project to v0.72, Flipper stopped detecting my apps. Besides not showing the app, it is displaying an 'DEVICE DISCONNECTED' error label. Beside that, React DevTools work properly, but the plugins do not, as if I didn't properly initialize them. To troubleshoot, I created a barebone project, and in that scenario, Flipper works as expected. This indicates that something went wrong during the upgrade process, but I'm having trouble pinpointing the exact cause.

I'd appreciate any insights or suggestions you might have to resolve this issue.

Here are some relevant libraries and versions I'm using:

Additionally, I've encountered an error in Flipper Logs, and while I'm not sure if it's related, I'll provide the error details for reference:

"onerror" event intercepted: Uncaught Error: Cannot add node "1" because a node with that id is already in the Store. {source: "/Applications/Flipper.app/Contents/Resources/app.asar.unpacked/defaultPlugins/flipper-plugin-react-devtools/dist/bundle.js", lineno: 11, colno: 31168, error: Error, stack: "Error: Cannot add node "1" because a node with that id is already in the Store. at /Applications/Flipper.app/Contents/Resources/app.asar.unpacked/defaultPlugins/flipper-plugin-react-devtools/dist/bundle.js:7694:19083 at w.emit (/Applications/Flipper.app/Contents/Resources/app.asar.unpacked/defaultPlugins/flipper-plugin-react-devtools/dist/bundle.js:11:31118) at /Applications/Flipper.app/Contents/Resources/app.asar.unpacked/defaultPlugins/flipper-plugin-react-devtools/dist/bundle.js:11:29130 at /Applications/Flipper.app/Contents/Resources/app.asar.unpacked/defaultPlugins/flipper-plugin-react-devtools/dist/bundle.js:7795:203209 at file:///Applications/Flipper.app/Contents/Resources/app.asar/bundle.js:946:399 at gl (file:///Applications/Flipper.app/Contents/Resources/app.asar/bundle.js:1557:115115) at file:///Applications/Flipper.app/Contents/Resources/app.asar/bundle.js:946:380 at EventEmitter.subscriptionCb (file:///Applications/Flipper.app/Contents/Resources/app.asar/bundle.js:1210:548) at EventEmitter.emit (node:events:390:28) at FlipperServerImpl.emit (file:///Applications/Flipper.app/Contents/Resources/app.asar/bundle.js:10:13828) at ServerAddOnModuleToDesktopConnection.onMessage (file:///Applications/Flipper.app/Contents/Resources/app.asar/bundle.js:936:939) at ServerAddOnModuleToDesktopConnection.emit (node:events:390:28) at ServerAddOnModuleToDesktopConnection.send (file:///Applications/Flipper.app/Contents/Resources/app.asar/bundle.js:937:1263) at ne. (/Applications/Flipper.app/Contents/Resources/app.asar.unpacked/defaultPlugins/flipper-plugin-react-devtools/dist/serverAddOn.js:321:18051) at ne.emit (node:events:390:28) at uo.Yv (/Applications/Flipper.app/Contents/Resources/app.asar.unpacked/defaultPlugins/flipper-plugin-react-devtools/dist/serverAddOn.js:1:36577)"} source: "/Applications/Flipper.app/Contents/Resources/app.asar.unpacked/defaultPlugins/flipper-plugin-react-devtools/dist/bundle.js"

Please let me know if you need any additional info.

rajeshp2511 commented 1 year ago

same issue

erez-unitronics commented 1 year ago

same

Hos1g4k1 commented 1 year ago

Same issue

simonadenic commented 1 year ago

Same issue.

nickprihodko commented 1 year ago

+ 1

ghost commented 1 year ago

Same.

dusanristic commented 1 year ago

Additionally note, everything works well on Android, so this is an iOS-specific problem.

rajeshp2511 commented 1 year ago

i am facing on android as well

dusanristic commented 1 year ago

Hey guys, related to iOS, this issue helped me. Make sure to call

#ifdef FB_SONARKIT_ENABLED
  InitializeFlipper(application);
#endif

inside - (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions function, before return statement.

@rajeshp2511 Do devices show up at all in Flipper, or do you only have a problem with displaying the app inside it?

dusanristic commented 1 year ago

Additionally, make sure to

gyanbhartip commented 1 year ago

Additionally note, everything works well on Android, so this is an iOS-specific problem.

With everything setup as the official guide, does not work on Android. Getting "Metro is connected but no Hermes apps were found" and similar errors in the Flipper logs as OP.

rajeshp2511 commented 1 year ago

@dusanristic Device is showing there but app is not visible

image

marcshilling commented 11 months ago

Hey guys, related to iOS, this issue helped me. Make sure to call

#ifdef FB_SONARKIT_ENABLED
  InitializeFlipper(application);
#endif

inside - (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions function, before return statement.

@rajeshp2511 Do devices show up at all in Flipper, or do you only have a problem with displaying the app inside it?

This is the answer. The newer versions of RN remove RCTAppSetupUtils so the React Native 0.68+ install instructions no longer apply. But use the React Native 0.67 instructions again and it will work. Docs should be updated!

amorimcode commented 10 months ago

@rajeshp2511 same problem here, only on android