Closed armata99 closed 3 years ago
Hi im trying to copy a file into cache directory using cp but i get this error I dont know why
[Error: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference]
here is my code:
RNFetchBlob.fs .cp('content://com.android.providers.downloads.documents/document/msf%3A2008', RNFetchBlob.fs.dirs.CacheDir+'/myfile.pdf') .then((result) => { console.log(result); let uploadedFile = pickedFile; uploadedFile.storageUri = pickedFile.uri; this.setState({ isLoading: false, pickedFile: '', previousFile: uploadedFile, }); }) .catch((err) => console.log(err));
here is my info:
react: 16.13.1 => 16.13.1 react-native: 0.63.2 => 0.63.2
test device: Samsung galaxy a51 with android 10
same for me, any solution?
Hi. Sadly this repo does not seem to be maintained anymore. You can switch to react-native-fs. see the docs here
react-native-fs
Hi im trying to copy a file into cache directory using cp but i get this error I dont know why
[Error: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference]
here is my code:
here is my info:
react: 16.13.1 => 16.13.1 react-native: 0.63.2 => 0.63.2
test device: Samsung galaxy a51 with android 10