fetch icon indicating copy to clipboard operation
fetch copied to clipboard

[Android] Streaming broken in development builds on Expo SDK50 due to ReactNativeFlipper

Open Vali-98 opened this issue 5 months ago • 1 comments

As previously pointed out in https://github.com/react-native-community/fetch/issues/13#issuecomment-1703097655 , ReactNativeFlipper breaks streaming completely.

With Expo SDK50, the nature of these files have changed:

React Native 0.73 changed from Java to Kotlin for Android Main* classes: MainApplication.java/MainActivity.java are now MainApplication.kt/MainActivity.kt. If you depend on any config plugins that use dangerous modifications to change these files, they may need to be updated for SDK 50 support.

In android/app/src/main/java/com/[name]/[app]/MainApplication.kt, here is the ReactNativeFlipper initialization:

if (BuildConfig.DEBUG) {
    ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}

Simply comment it out and streaming will work once more.

if (BuildConfig.DEBUG) {
    // hacky fix for: https://github.com/react-native-community/fetch
    // ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}

Though the issue is fixed on my end, I am leaving this here for the few people who come across this problem.

Vali-98 avatar Jan 27 '24 06:01 Vali-98