bamlab / react-native-flipper-performance-monitor

An attempt to have a lighthouse for React Native. Flipper plugin to show a graph of the React Native performance monitor
MIT License
588 stars 17 forks source link

reactContext is null inside FPSMonitor Class #71

Closed whoami-shubham closed 2 years ago

whoami-shubham commented 2 years ago

Thanks for creating this library, It works well with apps created using React Native, However, I was trying to use it for the brownfield react native App. I have manually linked this library but when I click on "Start Measuring " it crashes with a null pointer Exception, then I logged some variables and I found reactContext was null.

image

I also tried after moving line 51 to 36 in the following file, I got the same result my ReactNativeFlipper.kt File

image
  "react": "17.0.2",
 "react-native": "0.66.3",
 "react-native-flipper-performance-plugin": "^0.3.1"
compileSdkVersion = 31
 targetSdkVersion = 31
 minSdkVersion = 21
 flipper Version 0.136.0
Almouro commented 2 years ago

Hi @whoami-shubham, thanks for this issue!

Nice debugging skills! 💪 I haven't worked with a brownfield app in a while (and this plugin has indeed not been tested by us on a brownfield app). I'm pretty sure your second attempt is the correct way to deal with this, but this might have been broken in the 0.3.0 update for expo support.

Could you retry with version 0.2.1 of the native plugin?

(Also for Android performance, you can give https://github.com/bamlab/android-performance-profiler a go if you feel like it. It requires no installation and support the native side as well. FPS reporting might be a bit wonky but is being fixed soon 🤞)

whoami-shubham commented 2 years ago

Thanks, I will try with version 0.2.1