microsoftconnect/intune-app-wrapping-tool-ios

Crash with latest SDK

mikektmobile opened this issue · 26 comments

Describe the bug:
Current app that is live has been working fine, we took the same app and updated ONLY the sdk wrapper and it now crashes on launch

To Reproduce
Steps to reproduce the behavior:
Open new sdk wrapped app. We have this app in the app store and in testflight, app store is fine testflight now crashes with new sdk

Expected behavior:
Open the app and not crash

Screenshots and logs:
Logs attached and enabled from settings sent to microsoft

Smartphone (please complete the following information):

  • Device: iphone xs max
  • OS: 16.6.1

Intune app wrapping tool (please complete the following information):
Latest version of the SDK for intune wrapper ios
Logs attached from wrap output

Additional context:
Add any other context about the problem here.
intune-app-wrapping-tool-ios-main.zip

crashlog-60C636B4-882A-40CE-B25A-0079E1DB7BA1 1.txt
crashlog-60C636B4-882A-40CE-B25A-0079E1DB7BA1.txt
crashlog-C715288F-3CF3-43FE-A787-42B7B466E5D1.txt

@mikektmobile Thanks for the details! I looked at the crash logs and the crash seems to originate from the app's applicationDidBecomeActive implementation. The IntuneMAMSwift stack that you see is only calling the app's implementation.

Thank you, im not seeing that in the logs, do you have a line of error you see that. Im going back to our team to discuss

It's from the crash logs:

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 advomobo 0x102f04450 ApplicationController.().init() + 584
1 advomobo 0x102f044a0 @objc ApplicationController.().init() + 20
2 advomobo 0x102f040c8 one-time initialization function for sharedInstance + 28
3 libdispatch.dylib 0x19c20beac dispatch_client_callout + 20
4 libdispatch.dylib 0x19c20d6ec dispatch_once_callout + 32
5 advomobo 0x102e13708 specialized AppDelegate.applicationDidBecomeActive(
:) + 952
6 advomobo 0x102e101b4 @objc AppDelegate.applicationDidBecomeActive(
:) + 48

@vigavadi Our team says nothing was changed prior to this new SDK, and it functioned without crashing. Ive attached more logs. Thanks
IntuneMAMDiagnosticFiles.txt

@mikektmobile We released a newer version last week 17.7.2. Can you check if that works? If not, is it possible to send the unwrapped ipa to vigavadi@microsoft.com?

Yes, Ill try that right now.

@vigavadi I just tested it and it still crashes - Ive sent over the IPA

@mikektmobile Which SDK version were you using before this?

@vigavadi I rolled back the SDK version to 17.3.0, and its working. But we need to know why that works and the latest SDK isnt.

Any update on this, Ive used this old version of the SDK on newer versions of our app and it works. But any new SDK prior still crashes the app.

@vigavadi Ive tested all SDKs and all SDK prior to 17.6.0 works. As soon as I wrap our app in 17.6.0 + it crashes.

Also what version of xcode is needed for the 17.6.x and higher SDK?

@mikektmobile Thanks for trying! Yes, I did notice that as well. I'm investigating what changed starting that version already. One quick question what Xcode version are you using?

@vigavadi we are on 14.2.x. We plan on moving to 15 next week.

Does your app restrict the schemes in LSApplicationQueriesSchemes by any chance? We added 2 new schemes with 17.6.0 to support broker authentication: https://github.com/AzureAD/microsoft-authentication-library-for-objc#configuring-msal.

@vigavadi please see attached screenshot of our scheme
Screenshot 2023-09-15 at 1 41 43 PM

It's hard to debug this because it doesn't crash if I attach the debugger. But, it seems to be related to the change that adds new values to the LSApplicationQueriesSchemes. Can you do a quick check, add msauthv2 and msauthv3 to the list and then wrap it with a version that did not crash before (> 17.6.0). Does that cause a crash?

@vigavadi We have added those two to the scheme and now when we wrap the app with an older wrapper it crashes, it didnt crash with the older wrapper before.

Thanks for trying. This confirms that it's the addition of the two schemes. Is there anything specific that you do for the schemes mentioned in the LSApplicationQueriesSchemes? Maybe some checks to not allow certain values?

@vigavadi Different reasons for each. But generally, they aren’t used to “not allow” something. Some are used for the share extension, zendesk to try to open in the native app if it's installed

@mikektmobile Is this fixed with 18.x releases?

@vigavadi can you tell me if 18.1.2 can use xcode 14.x. We have not updated to xcode 15.. I see that 17.7.6 can use 14.x so wanted to make sure 18.1.2 can as well

@mikektmobile No that only works for Xcode15. All the 18.x are with Xcode15.

@vigavadi Ive tested with the latest 17.7.6 sdk and the latest version of our app and its a constant crash still

@mikektmobile Are you also integrating the MSAL library on your end? Do you have an AAD registration for your app?