How do I get the Media File "Provider" to load into the manifest on Android?

I have Chester’s Camera Application compiling and working.

I now want to play with my own application.

When I use Chester’s implementation of just the Action TakePhotoFromCameraAction on my own form in my own application or use a IFMXCameraService directly I get an Exception
“java.lang.illegalArgumentException no meta data for provider with authority
com.embarccardero.SampleCamera.fileprovider”

Chester’s project manifest file contains a provider section

          <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="com.embarcadero.CameraCGW.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>

My manifest does not.

Chester makes no mention about needing to do something special and his Template manifest does not seem to be edited.

What actions cause Delphi to include a “Provider” in the manifest and the provider files in the package?.

Did you implement the permission request as per C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Media\PhotoEditorDemo

And the Project Options - Application - Uses Permissions for Media + File Storage

You need to select the Secure File Sharing option in the Entitlements List in the Project Options

Thanks Guys

Entitlements>Secure File Sharing fixed it.

1 Like