Mintegral-official / MintegralAdSDK-iOS-new

Mintegral ad sdk for iOS
https://dev.mintegral.com/doc/index.html?file=sdk-m_sdk-ios&lang=en
Other
5 stars 3 forks source link

Application tried to present a nil modal view controller on target <MTGInnerStoreProductViewController: 0x13c1ca800>. #15

Closed GlassOfRedWinemm closed 4 days ago

GlassOfRedWinemm commented 2 weeks ago

NSInvalidArgumentException Application tried to present a nil modal view controller on target <MTGInnerStoreProductViewController: 0x13c1ca800>. Device:iPhone OS Version:iOS 17.1.1 0 CoreFoundation 0x00000001a980887c B37A1273-B0C2-312E-9E0B-7143FB645C69 + 968828 1 libobjc.A.dylib 0x00000001a1b2bc00 objc_exception_throw + 60 2 UIKitCore 0x00000001ac0c2c7c F1A8BD61-9CF2-3054-B622-CB63D6CEB4CB + 7875708 3 UIKitCore 0x00000001ac0c32f4 F1A8BD61-9CF2-3054-B622-CB63D6CEB4CB + 7877364 4 UIKitCore 0x00000001ac0c35f0 F1A8BD61-9CF2-3054-B622-CB63D6CEB4CB + 7878128 5 UIKitCore 0x00000001ac0c325c F1A8BD61-9CF2-3054-B622-CB63D6CEB4CB + 7877212 6 UIKitCore 0x00000001ac0c36ac F1A8BD61-9CF2-3054-B622-CB63D6CEB4CB + 7878316 7 AppLovinQualityService 0x0000000107eda278 __46-[SafeDKAdsInterceptor swizzleViewControllers]_block_invoke + 116 8 StoreKit 0x00000001d1c16a44 54F79750-144E-36D9-B3F1-3D606ACAEA13 + 240196 9 libdispatch.dylib 0x00000001b16d76a8 89420547-98A3-352A-AD2B-BBCB6006FB29 + 9896 10 libdispatch.dylib 0x00000001b16d9300 89420547-98A3-352A-AD2B-BBCB6006FB29 + 17152 11 libdispatch.dylib 0x00000001b16e7998 89420547-98A3-352A-AD2B-BBCB6006FB29 + 76184 12 libdispatch.dylib 0x00000001b16e75b0 _dispatch_main_queue_callback_4CF + 44 13 CoreFoundation 0x00000001a975320c B37A1273-B0C2-312E-9E0B-7143FB645C69 + 225804 14 CoreFoundation 0x00000001a974ff18 B37A1273-B0C2-312E-9E0B-7143FB645C69 + 212760 15 CoreFoundation 0x00000001a974f668 CFRunLoopRunSpecific + 608 16 GraphicsServices 0x00000001ecb1a5ec GSEventRunModal + 164 17 UIKitCore 0x00000001abb6c2b4 F1A8BD61-9CF2-3054-B622-CB63D6CEB4CB + 2278068 18 UIKitCore 0x00000001abb6b8f0 UIApplicationMain + 340 19 UnityFramework 0x000000010edc2564 UnityFramework + 107876 20 App 0x0000000100cc412c App + 33068 21 dyld 0x00000001cc1a2dcc A795AD37-6266-385E-95E6-C1CA804C926E + 24012

Expected Behavior The modal view controller should be presented without crashing.

Actual Behavior The app crashes with an NSInvalidArgumentException when trying to present a nil modal view controller.

Additional Information Please investigate this issue and provide any possible fixes or workarounds. Thank you!

red3 commented 1 week ago

MTGInnerStoreProductViewController is just a subclass of system's SKStoreProductViewController, it won't present any nil controller, maybe you can check:

  1. if your own code has some logic like found the topmost view controller and MTGInnerStoreProductViewController is the topmost view controller and you use it to present another controller;
  2. look at implementation of [SafeDKAdsInterceptor swizzleViewControllers], check if this would return nil controller or not.
GlassOfRedWinemm commented 4 days ago

MTGInnerStoreProductViewController 只是系统的 SKStoreProductViewController 的一个子类,它不会显示任何零控制器,也许你可以检查一下:

  1. 如果你自己的代码有一些逻辑,比如找到最顶层的视图控制器,并且 MTGInnerStoreProductViewController 是最顶层的视图控制器,并且你使用它来呈现另一个控制器;
  2. 查看的实现[SafeDKAdsInterceptor swizzleViewControllers],检查这是否会返回 nil 控制器。

I feel like the problem is caused by a user manually crossing out the app when watching an MTG reward/interstitial ad