Closed luccadumas closed 4 years ago
It works for me.
-> I uninstalled lib -> Removed node_modules (rm -rf node_modules) -> I installed node_modules again -> I installed the lib -> I followed the tutorial for the new version of lib (https://github.com/joltup/rn-fetch-blob) -> I manually linked the package (https://github.com/wkh237/react-native-fetch-blob/wiki/Manually-Link-Package#user-content-link-android-package) -> I manually added permissions for Android
async function permissionsAndroid() { try { const granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE ); openPDF(); //call to the function of opening the PDF similar to what you do in the video } catch (err) { console.warn(err); } }
I think the lib link was missing manually, I had tried it once, but there was already a lot of trash in the cache, so I decided to uninstall everything and do the whole process again.
Now it works for me! :D
react-native-cli: 2.0.1 react-native: 0.61.5 rn-fetch-blob: 0.12.0
On IOS, lib worked fine, but on Android this error is coming up:
I'd appreciate if you could help me.
`> Task :rn-fetch-blob:compileReleaseJavaWithJavac FAILED /Users/etros/Documents/workspace/sp-react-native/node_modules/rn-fetch-blob/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java:601: error: unreported exception IOException; must be caught or declared to be thrown callback.invoke("Unexpected FileStorage response file: " + responseBody.string(), null); ^ 1 error
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':rn-fetch-blob:compileReleaseJavaWithJavac'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 3m 44s `