facebook / flipper

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

Network plugin does not work on the iOS (react-native 0.72.3) #4969

Open shockwave13 opened 1 year ago

shockwave13 commented 1 year ago

Network plugin does not work on the iOS (working fine on android).

The application connects successfully, I can see the console logs. But only these 4 requests are output to the network and that's it

image

react-native version is: "react-native": "0.72.3",

I tried different versions of flipper. For example 0.203.0 and 0.176.1

Configure as described here. Tried both automatic and manual setup but none of the options helped.

Setup doctor say that there are no problems with the configuration.

image

Will be appreciated for help!

shlaikov commented 1 year ago

I have the same thing, it pops up when I run the command RCT_NEW_ARCH_ENABLED=1 bundle exec pod install. Most likely this is related.

System:
  OS: macOS 13.5
  CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  Memory: 961.07 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.0
    path: ~/.nvm/versions/node/v18.17.0/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v18.17.0/bin/yarn
  npm:
    version: 9.6.7
    path: ~/.nvm/versions/node/v18.17.0/bin/npm
  Watchman:
    version: 2023.07.24.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.11.3
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK:
    API Levels:
      - "23"
      - "28"
      - "30"
      - "32"
      - "33"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 32.0.0
      - 32.1.0
      - 33.0.0
    System Images:
      - android-30 | Google APIs Intel x86 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9514443
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.8
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Error message:

[!] CocoaPods could not find compatible versions for pod "SocketRocket":
  In Podfile:
    FlipperKit/FlipperKitNetworkPlugin (= 0.209.0) was resolved to 0.209.0, which depends on
      FlipperKit/Core (= 0.209.0) was resolved to 0.209.0, which depends on
        SocketRocket (~> 0.7.0)

    React-Core/RCTWebSocket (from `../node_modules/react-native/`) was resolved to 0.72.3, which depends on
      SocketRocket (= 0.6.1)
alvaroraminelli-cb commented 1 year ago

+1, facing the same issue after running pod install

[!] CocoaPods could not find compatible versions for pod "SocketRocket":
  In Podfile:
    FlipperKit/SKIOSNetworkPlugin (= 0.211.0) was resolved to 0.211.0, which depends on
      FlipperKit/FlipperKitNetworkPlugin (= 0.211.0) was resolved to 0.211.0, which depends on
        FlipperKit/Core (= 0.211.0) was resolved to 0.211.0, which depends on
          SocketRocket (~> 0.7.0)

    React-Core/RCTWebSocket (from `../../../../node_modules/react-native/`) was resolved to 0.72.3, which depends on
      SocketRocket (= 0.6.1)
kirgy commented 1 year ago

We are also facing this same problem. After upgrading to React Native 0.72.4 from 2 major versions and reinstalling Flipper as per the setup guides for a bare/unmanaged app, running pod install I get this:

[!] CocoaPods could not find compatible versions for pod "SocketRocket":
  In Podfile:
    FlipperKit (= 0.210.0) was resolved to 0.210.0, which depends on
      FlipperKit/Core (= 0.210.0) was resolved to 0.210.0, which depends on
        SocketRocket (~> 0.7.0)

    React-CoreModules (from `../node_modules/react-native/React/CoreModules`) was resolved to 0.72.4, which depends on
      SocketRocket (= 0.6.1)
stefan-schweiger commented 1 year ago

As far as I can see the last version which uses SocketRocket 0.6.1 is Flipper 0.203.0

So when I use this version the build works without a problem, but the Network plugin still does not work (React Native 0.72.4).

amonraRivers commented 1 year ago

same issue here

alzalabany commented 1 year ago

any updates ? :/

raybelisle commented 1 year ago

Yeah, same issue here. Would be good to have someone from Flipper comment?

vpetrykov commented 1 year ago

try deleting Flipper-related inits from AppDelegate.m file. That what helped after bumping 1 major to 0.72.x and having similar networking issues as you guys have described

serhiy-z-israelit-pro commented 1 year ago

try deleting Flipper-related inits from AppDelegate.m file. That what helped after bumping 1 major to 0.72.x and having similar networking issues as you guys have described

this partly fixes the issue when your project uses @react-navigation/native, network tool doesn't show response body. But if you are using react-native-navigation (by wix, v7.35.0) flipper won't be able to connect to ios app at all, not sure if it's fixed in latest releases of react-native-navigation

HarshitMadhav commented 9 months ago

I was facing the same issue so in AppDelegate.m file I just commented out the network plugin initialisation and restarted the app, network plugin then started working fine.

Comment this: // [client addPlugin: [[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];

raybelisle commented 9 months ago

I was facing the same issue so in AppDelegate.m file I just commented out the network plugin initialisation and restarted the app, network plugin then started working fine.

Could you show what you changed? I thought I removed the values but no change. Not sure if I'm not referencing the correct item?

HarshitMadhav commented 9 months ago

@raybelisle edited my comment

ms314006 commented 8 months ago

I was facing the same issue so in AppDelegate.m file I just commented out the network plugin initialisation and restarted the app, network plugin then started working fine.

Comment this: // [client addPlugin: [[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];

work for me!

sato-ryoka commented 3 months ago

I created a new Expo project earlier and tried the following, but I got the same error.

I tried it with the stable react-native versions (0.74.2, 0.73.8, 0.71.19, 0.70.15), but it didn't work. Regarding 0.70.15, it was not possible because the version did not match with React.

npx expo prebuild
cd ios
pod install
sato-ryoka commented 3 months ago

I don't know what the direct cause is, but after reinstalling cocoapods cli, I moved to the ios directory and did a pod update, and the error disappeared. There was no error during prebuild. I hope it helps someone. ^^;