AndroidManifest.xml image capture function causes an error

Hi,

Based on the samples, I configured the AndroidManifest.xml file:

    <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>

But I had another setting for image capture:

    <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">

      <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>

    </provider>

The problem is if I set it to pdf I can't capture an image. If I set it to image, then the Pdf will be an empty file.


It also doesn't work if provider_paths and file_paths are both kept set.

Is there a workaround?

Regards:

Szepligeti Ferenc

 





2 Replies

SF Szépligeti Ferenc January 25, 2022 07:08 AM UTC

Hi,

Solution:

<provider android:authorities="com. mycompany.myapp.provider" android:exported="false" android:grantUriPermissions="true" android:name="xamarin.essentials.fileProvider">

      <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />

    </provider>

       </application>

</manifest>


I found it on the Net. Not sure why exactly, but it works!

Regards:

Szepligeti Ferenc



SV Surya Venkatesan Syncfusion Team January 25, 2022 01:24 PM UTC

Hi Szepligeti,


Thanks for the details. We recommend you refer to the following link to get more details to load image from the camera and insert it to PDF document in Xamarin Forms, https://www.syncfusion.com/kb/11950/how-to-load-image-from-camera-and-insert-it-to-pdf-document-in-xamarin-forms


Please let us know if you need any further assistance with this.


Regards,

Surya V


Loader.
Up arrow icon