Saving pdf file doesn't work on Android 10

Hi,
I'm using this example:
https://help.syncfusion.com/file-formats/pdf/create-pdf-file-in-xamarin

The example project is working fine while using Android 9, however it doesn't work on Android 10.
Do you can update this example to work also on Android 10? 

Thank you,
Andreas

4 Replies 1 reply marked as answer

SL Sowmiya Loganathan Syncfusion Team March 18, 2021 12:59 PM UTC

Hi Andreas,   

Thank you for contacting Syncfusion support.   

We have modified the Xamarin Forms sample to work with Android 10 and please find the download link from below,   

Please find the following changes in AndroidManifest.xml file located under Properties of Android project.   

<?xml version="1.0" encoding="utf-8"?>  
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.GettingStarted">  
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29" />  
    <application android:label="GettingStarted.Android" android:requestLegacyExternalStorage="true">  
        <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true">  
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />  
        </provider>  
    </application>  
</manifest>  


Please try the above sample in your end and let us know the result.   

Regards,  
Sowmiya Loganathan 



BY Brian York April 14, 2021 02:17 AM UTC

Hi,
The sample code did not work for me with Android 11 (API 30). I get the runtime permission dialog, but then I get this error:
Java.IO.FileNotFoundException: /storage/emulated/0/Syncfusion/BraceTrack.pdf: open failed: ENOENT (No such file or directory) ---> Android.Systems.ErrnoException: open failed: ENOENT (No such file or directory)

--Brian


GK Gowthamraj Kumar Syncfusion Team April 14, 2021 01:21 PM UTC

Hi Brian, 
 
Thank you for contacting Syncfusion support. 
 
Currently, we are checking the sample with Android 11 device (API 30) on our end and we will update the further details on April 16th 2021. 
 
Regards, 
Gowthamraj K 



GK Gowthamraj Kumar Syncfusion Team April 16, 2021 03:04 PM UTC

Hi Brain, 
 
Thank you for your patience. 
 
If you are trying the sample creation in Android device 11.0 (ApiLevel_30), kindly please try the below suggestion in your end and let us know the result,    
  • Add android:requestLegacyExternalStorage="true" to the Android Manifest file, on Android 11
<application ...   
    android:requestLegacyExternalStorage="true" ... >   
   
  
  • Please try to change a permission property in your .xml file and group need to mentioned as like below.
<manifest>   
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE">   
           <group android:gid="sdcard_rw" />   
           <group android:gid="media_rw" />     
       </uses-permission >   
   
        ...   
        <application>   
            ...   
            <activity>    
                ...   
            </activity>   
        </application>   
    </manifest>   
  •  Please Enable Storage permission on your application.
  • In the emulator settings, you need to specify the size of external storage ("SD Card") properly. By default, the "external storage" field is empty, and that probably means there is no such device and EACCES is thrown even if permissions are granted in the manifest.
Please try the above suggestion in your end and let us know the result.   
 
Regards, 
Gowthamraj K 


Marked as answer
Loader.
Up arrow icon