Unable to get provider com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider

185 Views Asked by At

When trying to deploy an app using Microsoft.Intune.Maui.Essentials.android we get an exception as below.

Java.Lang.RuntimeException: 'Unable to get provider com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider: java.lang.ClassNotFoundException: Didn't find class "com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider" on path: DexPathList[[zip file "/data/app/~~uJpDSAeopTW92kLUdUgp1w==/jp.co.cegb.archxtractpush-iXeGEc6Slh13UJIq_1k60Q==/base.apk"],nativeLibraryDirectories=[/data/app/~~uJpDSAeopTW92kLUdUgp1w==/jp.co.cegb.archxtractpush-iXeGEc6Slh13UJIq_1k60Q==/lib/arm64, /data/app/~~uJpDSAeopTW92kLUdUgp1w==/jp.co.cegb.archxtractpush-iXeGEc6Slh13UJIq_1k60Q==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]'

The android manifest is as follows

<provider tools:replace="android:authorities" android:name="com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true">
    <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" tools:replace="android:resource" />
</provider>

Details:

  • Microsoft.Intune.Maui.Essentials.android Version: 9.5.2-Beta2

  • Operating System (Mac, Linux, Windows) and Version:Windows

  • Visual Studio Version: 17.7.4

In Xamarin Android Intune SDK this was not throwing an error.

1

There are 1 best solutions below

6
On

You can try to change the com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider to androidx.core.content.FileProvider. Such as:

<provider tools:replace="android:authorities" android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true">
    <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" tools:replace="android:resource" />
</provider>