I have upgraded react-native to 0.62 and i got the problem of Network error for Android only, iOS works fine.
I use FormData object to populate data formated as
const data = new FormData();
// On Android i add file protocol to file path - file://...
data.append('photos', {
uri: 'file:///data/.../my-image.jpeg',
type: 'image/jpeg',
name: 'my-image.jpeg'
});
and other textual data
data.append('description', 'my long description...');
Does anyone have the problem?
I have tried multiple Android SDKs 27, 28, 29, and got same problem on all :(
The things is if i do not upload images, but only textual data request works just fine :(
Any suggestion welcome :)?
It is happening because of Flipper network plugin.
Comment line number 43 in the file android/app/src/debug/java/com/<yourappname>/ReactNativeFlipper.java
38 NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
39 NetworkingModule.setCustomClientBuilder(
40 new NetworkingModule.CustomClientBuilder() {
41 @Override
42 public void apply(OkHttpClient.Builder builder) {
43 // builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
44 }
45 });
46 client.addPlugin(networkFlipperPlugin);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With