Skip to content

Fatal crash with Microsoft Wrapping Tool for Android on Gradle 8.2+ #119

@JosephNK

Description

@JosephNK

Questions to Ask Before Submission

  1. Does you app launch successfully without wrapping?
    Yes.
  2. Have you reviewed the prerequisites for App Wrapping?
    Yes.
  3. Does your issue have a solution in the Troubleshooting Guide?
    No.
  4. Have you checked the Microsoft Intune App SDK for Android repository for similar issues?
    No.
  5. Are you using the latest version of the App Wrapper?
    Yes. Version 1.0.4934.3, 1.0.4954.3

Describe the bug:
The app crashes immediately after launching when wrapped with Microsoft Wrapping Tool for Android in projects using Gradle 8.2 or higher. The app runs successfully without wrapping, but fails after the wrapping process is applied.

To Reproduce
Steps to reproduce the behavior:

  1. Create or use a Flutter Android app project with Gradle 8.2 or higher
  2. Wrap the app using Microsoft Wrapping Tool for Android
  3. Install the wrapped app on a device
  4. Launch the app
  5. App crashes immediately

Expected behavior:
The wrapped app should launch and run normally, just as it does in the non-wrapped version.

Screenshots and logs:

12-17 16:50:43.985 25616 25616 E AndroidRuntime: FATAL EXCEPTION: main\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: Process: corp.ncsoft.test, PID: 25616\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo\{corp.ncsoft.test/com.microsoft.intune.mam.client.app.startup.MAMStartupActivity\}: java.lang.NullPointerException: Attempt to invoke interface method 'void com.microsoft.intune.mam.client.app.FragmentBehavior.onAttachContext(android.content.Context, com.microsoft.intune.mam.client.app.HookedFragmentBase)' on a null object reference\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4184)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4340)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2584)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:226)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:313)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:8810)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void com.microsoft.intune.mam.client.app.FragmentBehavior.onAttachContext(android.content.Context, com.microsoft.intune.mam.client.app.HookedFragmentBase)' on a null object reference\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at com.microsoft.intune.mam.client.app.MAMFragment.onAttach(MAMFragment.java:50)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1247)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2431)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2210)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2166)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2067)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:822)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at androidx.lifecycle.J.b(Unknown Source:41)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at androidx.lifecycle.r.onActivityCreated(Unknown Source:7)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at com.microsoft.intune.mam.client.lifecycle.MAMActivityLifecycleCallbacks.onActivityCreated(:56)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.Application.dispatchActivityCreated(Application.java:387)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.Activity.dispatchActivityCreated(Activity.java:1420)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.Activity.onCreate(Activity.java:1702)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at com.microsoft.intune.mam.client.app.startup.MAMStartupActivity.onCreate(MAMStartupActivity.java:39)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:8657)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:8636)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4165)\
12-17 16:50:43.985 25616 25616 E AndroidRuntime: 	... 12 more\

Smartphone (please complete the following information):

  • Device: Samsung Galaxy Z Fold 2 5G
  • OS Version: Android 12+

Intune app wrapping tool (please complete the following information):

  • What version of the wrapper are you using? Are you using the latest version?
    1.0.4934.3, 1.0.4954.3
  • What platform is your app based in (Java, Xamarin based, Cordova, etc)?
    Flutter
  • For pre-wrapping errors, does the app build without being wrapped?
    Yes
  • For post-wrapping errors, does the app launch without being wrapped?
    Yes
  • Who is the customer?
    Internal users with own devices
  • Do you see a trend with it only being reproduced on a specific device?
    No

Additional context:
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions