microsoftconnect / ms-intune-app-sdk-android

Intune App SDK for Android enables data protection features and mobile app management via Microsoft Intune
45 stars 18 forks source link

[.NET MAUI] Unable to get provider com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider: java.lang.ClassNotFoundException #184

Closed MikeP0911 closed 1 year ago

MikeP0911 commented 1 year ago

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

MikeP0911 commented 1 year ago

@Archit-Pikle Could you please look into this ? Is there something that we are missing. I compared the DLL of the latest and the Xamarin Bindings Intune Android SDK. This seems to be missing. Or is there any alternative for com.microsoft.intune.mam.client.support.v4.content.MAMFileProvider

Thank you

meghandaly commented 1 year ago

@MikeP0911 Support for the Android Support libraries was removed in MAM SDK 8.0.0.

It is recommended that your app transition to AndroidX libraries and functionality. The AndroidX FileProvider can be used and requires no special modifications.

We will be reviewing our documentation and removing any notes regarding the support libraries that were not properly scrubbed before.

MikeP0911 commented 1 year ago

@meghandaly I understand that [androidx.core.content.FileProvider] can be used even for Intune applications.

Thank you