Skip to content

[iOS] App crash when trying to upload file with alamofire 5 #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
paszek opened this issue May 20, 2025 · 1 comment
Open

[iOS] App crash when trying to upload file with alamofire 5 #157

paszek opened this issue May 20, 2025 · 1 comment

Comments

@paszek
Copy link

paszek commented May 20, 2025

Mobile iOS app is distributed through global App Store but as private app shared with an organization.
Corporate user is authorized by NTLM properly and can use app until it crashes which happens when its trying to upload file to server.
That file is a photo that is taken (by the same app) right before upload.
Upload is implemented with Alamofire method AF.upload.
When MAMSDK is not initialized at app start, there is no crash during upload (in dev env).
Other HTTP requests work without errors.
App worked with Alamofire 4 but I had to migrate to Alamofire 5.

As You will see in crash logs there is call to Alamofire from CTXMAMNetwork
I'm dev outside of organization and I don't have access to prod env where MAMSDK works with Citrix stack.
Crash log was sent to me by organizations user.

Thread 9 name:  com.apple.CFNetwork.CustomProtocols
Thread 9 Crashed:
0   libdispatch.dylib             	       0x19adf23b4 _dispatch_assert_queue_fail + 120
1   libdispatch.dylib             	       0x19adf233c dispatch_assert_queue + 196
2   libswiftDispatch.dylib        	       0x19c44ab18 _dispatchPreconditionTest(_:) + 48
3   Alamofire                     	       0x102706f44 Session.request(for:) + 136
4   Alamofire                     	       0x102713fa0 SessionDelegate.urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:) + 284
5   Alamofire                     	       0x10271404c @objc SessionDelegate.urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:) + 104
6   CTXMAMNetwork                 	       0x102f9a168 -[AGSecureBrowseProtocol URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:] + 328
7   CTXMAMNetwork                 	       0x102f895f8 __92-[CTXMAMUrlSession URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]_block_invoke + 68
8   Foundation                    	       0x191ce1ec8 __NSThreadPerformPerform + 264
9   CoreFoundation                	       0x1930b3f3c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
10  CoreFoundation                	       0x1930b3ed0 __CFRunLoopDoSource0 + 176
11  CoreFoundation                	       0x1930b6b30 __CFRunLoopDoSources0 + 244
12  CoreFoundation                	       0x1930b5d2c __CFRunLoopRun + 840
13  CoreFoundation                	       0x193108274 CFRunLoopRunSpecific + 588
14  CFNetwork                     	       0x194627020 +[__CFN_CoreSchedulingSetRunnable _run:] + 416
15  Foundation                    	       0x191d5aa54 __NSThread__start__ + 724
16  libsystem_pthread.dylib       	       0x21dc2d7d0 _pthread_start + 136
17  libsystem_pthread.dylib       	       0x21dc2d480 thread_start + 8

Apart from latest MAMSDK for iOS 25.3.0.1 there are dependencies:

  • Alamofire (~> 5.9.0)
  • DLRadioButton (~> 1.4)
  • Firebase/Core (~> 10.22.0)
  • Firebase/Messaging (~> 10.22.0)
@dodododjk
Copy link
Collaborator

Hi @paszek

  • Alamofire is not supported​​ in the MAM SDK environment, the relevant http/https requests will not be intercepted by MAM SDK.
  • ​​Recommended Solution:​​ Use native URLRequest with URLSession for network requests instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants