vinzscam/react-native-file-viewer

Won't open file on Android

JeremyBradshaw7 opened this issue · 2 comments

Since I upgraded gradle from 2.2.+ to 3, this package has stopped working on Android, the new onDismiss callback is being fired more or less immediately. I'm downloading the file first from a remote location to local via RNFS, then viewing the local copy. I've upgraded to the latest version of this package and RNFS, and fully relinked.

Any ideas?

No movement on this? It's becoming critical for us. It's odd but, even though I download the file first via RNFS and try to open the file from it's local path, the Android device sometimes shows the error: "Unable to open the document. The file isn't available offline. Make file "Available offline" in the file's Options menu".

Never mind, I was downloading via RNFS to the TemporaryDirectoryPath without adding a trailing '/' to the path before appending my filename. Putting that / in solved the issue. Curious that on iOS the TemporaryDirectoryPath includes a trailing / but on Android it doesn't - not the fault of this package though.