react-native-file-opener
react-native-file-opener copied to clipboard
[Android] Crashed if targetSdkVersion >= 24 on Android N devices
如果targetSdkVersion >= 24, 在Android N设备上使用file://打开文件会崩溃. 应使用content://替代.
refer to: http://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-storage-emulated-0-test-txt-exposed
+1
I am using SDK Version 27. The problem is that version 0.2 of this React Native plugin does not include the changes as specified by the FileProvider API. What I did was to change my package.json file to download the Git repository instead:
"react-native-file-opener": "git://github.com/huangzuizui/react-native-file-opener.git"
Furthermore I downloaded all files to an external paths which is why I needed to change my files_path.xml
file to this:
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-files-path name="pdf" path="pdf/"/>
</paths>
Hope that helps!
所以请问 js里面能改吗?
@LionelWei 请问。怎么改? 我不懂安卓啊。
我试了,切换到23 可以打开。