androidreactjsreact-nativereact-native-fetch-blob

RNFetchBlob.mkdir got 1 arguments, expected 2


When i try to setup ongoing react-native project in that one of the plugin is react-native-fetch-blob i'll try many but can't resolve this issue.

also i remove that plugin from app and resetup all step from npm react-native-fetch-blob

after following all step getting same issue.

 `RNFetchBlob.fetch('POST', 'api', {
        'Content-Type': 'application/multipart/form-data'
    }, [
        {name: 'file', filename: filename, data: RNFetchBlob.wrap(PictureURI)}

    ])
        .then((responseData) => {
          // console.log("image uploaded",responseData);
            // console.log("----------Upload Image Test---RESPONSE---------");
        })
        .catch(err => {
           // console.log(err);
           // console.log("----------Upload Image Test---RESPONSE--ERROR-------");
        })`

in this plugin i'm only used the fetch method but my project gives me error mkdir method.


Solution

  • Resolve this issue following steps:
    react-native unlink react-native-fetch-blob
    npm uninstall react-native-fetch-blob --save
    yarn add react-native-fetch-blob (assuming your system already 
    installed yarn)
    RNFB_ANDROID_PERMISSIONS=true react-native link
    
    then uninstall app from device/simulator/emulator and run command
    react-native run-android
    work perfect. 
    :)