Issue
I tried to upload some data including an image to server using Axios.
It's working perfectly on iOS, but on Android, it returned Network Error
const data = new FormData();
data.append('tag', tag.METHOD_TAG_UPLOAD_PHOTO);
data.append('app_version', 1);
data.append('os_type', tag.OS_TYPE);
data.append('store_code', kodetoko);
data.append('photo', {
uri: image_picked.uri,
type: 'image/jpeg',
name: judul + ".jpg"
});
I tried to search for solution elsewhere, they said that the problem is within the type of the photo's object, it needs to use image/jpeg type. I'm using it but it still return Network Error. Please help.
Solution
Open this dir 'android/app/src/debug/java/com/flatApp/ReactNativeFlipper.java'
Comment the line as per below code:
NetworkingModule.setCustomClientBuilder( new NetworkingModule.CustomClientBuilder() { @Override public void apply(OkHttpClient.Builder builder) { // builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); } });
Answered By - Qamber
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.