googleads / googleads-mobile-flutter

A Flutter plugin for the Google Mobile Ads SDK
Apache License 2.0
335 stars 274 forks source link

(Crash - ios) -[FLTAppStateNotifier handleDidEnterBackground] #1138

Open binSaed opened 1 month ago

binSaed commented 1 month ago

Plugin Version

google_mobile_ads: ^5.1.0

[REQUIRED] Step 2: Describe the problem

Steps to Reproduce

  1. open the app
  2. go to background
  3. Sometimes APP crashed in the background
Screenshot 2024-07-17 at 6 20 02 AM

Actual results:

Logs Crashlytics ``` Crashed: com.apple.main-thread 0 Runner 0x369958 -[FLTAppStateNotifier handleDidEnterBackground] + 127 (FLTAppStateNotifier.m:127) 1 CoreFoundation 0x2f794 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 128 2 CoreFoundation 0x2f170 ___CFXRegistrationPost_block_invoke + 88 3 CoreFoundation 0x2f0b8 _CFXRegistrationPost + 440 4 CoreFoundation 0x2e608 _CFXNotificationPost + 728 5 Foundation 0x29f10 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 6 UIKitCore 0x6039bc -[_UISceneLifecycleMonitor didEnterBackground] + 244 7 UIKitCore 0x603bc4 -[_UIWindowSceneFBSSceneLifecycleMonitor didEnterBackground] + 52 8 UIKitCore 0x18b298 _UIScenePerformActionsWithLifecycleActionMask + 112 9 UIKitCore 0x2a07f4 __111-[_UIWindowSceneFBSSceneLifecycleMonitor transitionToTargetState:fromState:withTransitionContext:preparations:]_block_invoke_4 + 156 10 UIKitCore 0x139f14 ___UISceneLifecycleSettingsUpdateBlockWithCanvasAndTransitionContext_block_invoke_2 + 296 11 UIKitCore 0x139a48 -[_UIWindowSceneFBSSceneLifecycleMonitor transitionToTargetState:fromState:withTransitionContext:preparations:] + 680 12 UIKitCore 0x139058 ___UISceneLifecycleSettingsUpdateBlockWithCanvasAndTransitionContext_block_invoke + 308 13 UIKitCore 0x138d54 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 116 14 UIKitCore 0x138c7c +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 15 UIKitCore 0x138504 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 16 UIKitCore 0x1381b4 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 17 UIKitCore 0x4c8e20 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.226 + 612 18 UIKitCore 0x137328 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 19 UIKitCore 0x137198 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 20 UIKitCore 0x136fd8 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336 21 FrontBoardServices 0xe524 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 660 22 FrontBoardServices 0xe270 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 152 23 FrontBoardServices 0xe10c -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 24 FrontBoardServices 0xe028 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 344 25 libdispatch.dylib 0x3dd4 _dispatch_client_callout + 20 26 libdispatch.dylib 0x786c _dispatch_block_invoke_direct + 288 27 FrontBoardServices 0xa490 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 28 FrontBoardServices 0xa410 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240 29 FrontBoardServices 0xa2e8 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28 30 CoreFoundation 0x3762c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 31 CoreFoundation 0x368a8 __CFRunLoopDoSource0 + 176 32 CoreFoundation 0x35058 __CFRunLoopDoSources0 + 244 33 CoreFoundation 0x33d88 __CFRunLoopRun + 828 34 CoreFoundation 0x33968 CFRunLoopRunSpecific + 608 35 GraphicsServices 0x34e0 GSEventRunModal + 164 36 UIKitCore 0x22aedc -[UIApplication _run] + 888 37 UIKitCore 0x22a518 UIApplicationMain + 340 38 Runner 0x9ce0 main + 11 (AppDelegate.swift:11) 39 ??? 0x1c305ed84 (Missing) ``` flutter doctor -v ``` [✓] Flutter (Channel stable, 3.19.6, on macOS 14.5 23F79 darwin-arm64, locale en-EG) • Flutter version 3.19.6 on channel stable at /Users/abdo/Developer/flutter_sdk/3.19.6 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 54e66469a9 (3 months ago), 2024-04-17 13:08:03 -0700 • Engine revision c4cd48e186 • Dart version 3.3.4 • DevTools version 2.31.1 [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc3) • Android SDK at /Users/abdo/Library/Android/sdk • Platform android-34, build-tools 35.0.0-rc3 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2024.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) [✓] IntelliJ IDEA Ultimate Edition (version 2024.1.4) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin version 241.17890.8 [✓] VS Code (version 1.91.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.92.0 [✓] Connected device (4 available) • Abdelrahman iPhone (mobile) • 00008110-00061D3E0E32401E • ios • iOS 17.6 21G5066d • iPhone 15 Pro Max (mobile) • 174EFA2C-CB7E-4017-9E74-D5552B17727E • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 14.5 23F79 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.127 ! Error: Browsing on the local area network for iPad. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources • All expected network resources are available. • No issues found! ```
malandr2 commented 1 month ago

Hi @binSaed, thanks for flagging. I've escalated this to engineering to take a closer look.