intune-app-sdk-xamarin icon indicating copy to clipboard operation
intune-app-sdk-xamarin copied to clipboard

JNI Error on GetPrimaryUser

Open rbev opened this issue 4 years ago • 7 comments

Describe the bug: When calling intune functionality, either querying policy or using broker authentication through ADAL the application will crash with a JNI error (log attached)

This issue is transient and my assumption is that it's related to some difference in authentication flows when tokens expire since it appears to happen at the same approximate time of day (5-6 hours after first run)

This appears to be similar to https://github.com/msintuneappsdk/intune-app-sdk-xamarin/issues/5 but the workaround described there does not fix the issue.

To Reproduce

The issue is difficult to reproduce and will go away as abruptly as it appeared. It appears to only affect Debug builds. The particular JNI call doesn't seem to be important and once this error surfaces it seems to persist for an hour or two and then vanish again for a while.

  • Full rebuild doesn't seem to help
  • Removing and reinstalling the application doesn't clear the error
  • A production build will work but when

Expected behavior: A clear and concise description of what you expected to happen.

Screenshots and logs:

intune_crash_log.txt

Smartphone (please complete the following information):

  • Device: Samsung Tab Active 2
  • OS: Android 8.1, Android 9.0

Intune App SDK Xamarin Bindings (please complete the following information):

  • Versions
    <PackageReference Include="microsoft.csharp" Version="4.5.0" />
    <PackageReference Include="microsoft.identitymodel.clients.activedirectory" Version="5.1.0" />
    <PackageReference Include="microsoft.intune.mam.remapper.tasks" Version="0.1.4428.1" /> 
    <PackageReference Include="microsoft.intune.mam.xamarin.android" Version="3.0.4428.1" />
    <PackageReference Include="Xamarin.Android.Support.Emoji.AppCompat" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v17.Leanback" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Forms" Version="4.1.0.581479" />
    <PackageReference Include="Xamarin.Android.Support.Compat" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.1" />
    <PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" />
  • I have just removed the MAMRemapper library and my application appears to work again, however due to the transient nature of the bug I can't yet confirm this.

rbev avatar Jul 18 '19 08:07 rbev