Unable to open PDF file on Android 11 - targetSdkVersion 30
See original GitHub issueHello,
I’ve been using this library for quite some time in order to open PDF files.
Recently, I’ve updated Android’s targetSdkVersion
to 30, and I’ve noticed the actionViewIntent
function is not functioning on Android 11.
Using it as: android.actionViewIntent(filePath, `application/pdf`);
No error or whatsoever is thrown, so not really possible to debug.
Currently, asking for these permissions on AndroidManifest.xml
:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
And have bothpreserveLegacyExternalStorage
& requestLegacyExternalStorage
set as true.
Using latest github:joltup/rn-fetch-blob#master
version
Has somebody else faced this issue after updating? Am I missing some specific settings?
Thanks in advance.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:8
Top Results From Across the Web
PDF.js can't show PDF from externalFilesDir at Android 11
I am using PDF.js to show PDF files inside my Android App. Up to Android 10 it worked fine, but starting with "targetSdkVersion...
Read more >Cannot create PDF files in Android 11 (Permission denied)
I am trying to create PDF with the nuget Syncfusion.Xamarin.Pdf version 19.3.0.47 and with Xamarin.Forms version 5.0.0.2196, ...
Read more >Fulfill common use cases while having limited package visibility
This section describes various ways to open URLs in an app that targets Android 11 or higher. Open URLs in a browser or...
Read more >[Android 11 DP/Beta] With READ_EXTERNAL_STORAGE ...
gradle, and all works normally. ... Then edit the app module build.gradle file, change targetSdkVersion to 29 and run the sample again. This...
Read more >Use of All files access (MANAGE_EXTERNAL_STORAGE ...
This is only applicable to apps that target Android 11 (API level 30) and declare the MANAGE_EXTERNAL_STORAGE permission, which is added in Android...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have found a solution. This library here is quite unmaintained, I’ve found some guys that are keeping it maintained and updated:
https://github.com/RonRadtke/react-native-blob-util
Had the same issue tho with that library, but found out a solution: https://github.com/RonRadtke/react-native-blob-util/issues/66
Basically adding:
on the
AndroidManifest.xml
Hope that makes it work for you guys, and definitely recommend switching to use the new maintained library!
I have the same problem, any solution?