citrix / citrix-mam-sdks

The MAM SDK instrument your apps to enable enforcing policies and controls that are configured in Citrix Endpoint Management.
https://developer.cloud.com/citrixworkspace/mobile-application-integration
11 stars 4 forks source link

MAM SDK crashing on some Android devices #120

Open shafersystems opened 2 months ago

shafersystems commented 2 months ago

the MAM SDK crashes on startup on one of our devices (Pixel 5a OS 14). It doesn’t crash on all devices, but it constantly crashes on this one.

Attached please find the crash log.
2024-04-25 17:31:52.173 27447-27447 AndroidRuntime com...tems.notate.enterprise.citrix E FATAL EXCEPTION: main Process: com.shafersystems.notate.enterprise.citrix, PID: 27447 java.lang.NullPointerException: Attempt to invoke interface method 'android.content.SharedPreferences$Editor android.content.SharedPreferences.edit()' on a null object reference at com.citrix.worx.sdk.SettingPreferences.UpdateWith(SettingPreferences.java:96) at com.citrix.worx.sdk.SettingPreferences.SendUpdateNotifForMaxFileCount(SettingPreferences.java:152) at com.citrix.worx.sdk.CtxLog.setMaxFileCount(CtxLog.java:373) at com.citrix.sdk.appcore.api.a.a(Unknown Source:34) at com.citrix.sdk.appcore.api.a.a(Unknown Source:67) at com.citrix.sdk.appcore.api.MamSdk.(Unknown Source:10) at com.citrix.sdk.appcore.api.MamSdk.getInstance(Unknown Source:27) at com.citrix.mvpn.h.d.(Unknown Source:5) at com.citrix.mvpn.h.b.a(Unknown Source:19) at com.citrix.mvpn.helper.MicroVPNTunnelHelper.i(Unknown Source:6) at com.citrix.mvpn.helper.MicroVPNTunnelHelper.a(Unknown Source:10) at com.citrix.mvpn.api.MicroVPNSDK.startTunnel(Unknown Source:4) at com.shafersystems.notate.data.mdm.citrix.CitrixLifecycleStorage$startTunnel$1.invokeSuspend(CitrixLifecycleStorage.kt:121) citrix crash[64].log

Annie-XIE commented 2 months ago

Hi @shafersystems

  1. From the stacktrace, the crash happend when configuring logger, where it used a null pointer for sharedPref. It seems the initialization is not totally successful when configuring the logger. We will check this part.
  2. Meanwhile, from the attached log file, there are ANRs before the crashing ANR in com.shafersystems.notate.enterprise.citrix ANR in com.zenprise. Did you do any operation for the two apps at that time? Just wondering if ANR and Crash are related.
  3. It constantly crash on this device (Pixel 5a, Android 14), did you have any other Android 14 device or Pixel 5a while OS isn't 14, if yes, could you please kindly have a try and share us the result?
shafersystems commented 2 months ago

Hi @Annie-XIE 1) Thanks for checking the crash. It happens consistently on this device. 2) These ANRs seem to happen when the MAM library is initializing. It takes a while but then it works. These issues have been consistent for a long time, so we don't think they are related to the crash. 3) Unfortunately, we don't have any other devices of this type and we haven't been able to replicate the issue on other devices.