OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
616 stars 213 forks source link

IOS app crash after update to v3.0.0 #415

Closed Trteich closed 3 years ago

Trteich commented 3 years ago

After update updating to v 3.0.0 my app crashes on ios. Tryied on latest IOS version and latest Flutter SDK(2.2.1)

CrashLog: 2021-06-13 17:17:04.595387+0300 Runner[9233:70766] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[OneSignal initWithLaunchOptions:]: unrecognized selector sent to class 0x10ba45368' First throw call stack: ( 0 CoreFoundation 0x00007fff20422fba exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007fff20193ff5 objc_exception_throw + 48 2 CoreFoundation 0x00007fff20431c48 CFExceptionProem + 0 3 CoreFoundation 0x00007fff204274cf forwarding + 1455 4 CoreFoundation 0x00007fff204297a8 _CF_forwarding_prep_0 + 120 5 Runner 0x000000010b999862 +[OneSignalPlugin registerWithRegistrar:] + 66 6 Runner 0x000000010b8a27b0 +[GeneratedPluginRegistrant registerWithRegistry:] + 1968 7 Runner 0x000000010b8a2dab $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 203 8 Runner 0x000000010b8a3113 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 211 9 UIKitCore 0x00007fff246bd6f1 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 232 10 UIKitCore 0x00007fff246bf33b -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 4046 11 UIKitCore 0x00007fff246c4d63 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1237 12 UIKitCore 0x00007fff23ce629b -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122 13 UIKitCore 0x00007fff24272726 _UIScenePerformActionsWithLifecycleActionMask + 88 14 UIKitCore 0x00007fff23ce6dad 101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198 15 UIKitCore 0x00007fff23ce686e -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 474 16 UIKitCore 0x00007fff23ce6bda -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 818 17 UIKitCore 0x00007fff23ce646f -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345 18 UIKitCore 0x00007fff23cee6d8 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 178 19 UIKitCore 0x00007fff2417c77d +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 871 20 UIKitCore 0x00007fff2428f60e _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 246 21 UIKitCore 0x00007fff23cee3de -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 361 22 UIKitCore 0x00007fff23b117d5 64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 797 23 UIKitCore 0x00007fff23b1024e -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 253 24 UIKitCore 0x00007fff23b1140e -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 208 25 UIKitCore 0x00007fff246c3203 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 508 26 UIKitCore 0x00007fff241a4ab4 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 358 27 FrontBoardServices 0x00007fff25a1b40b -[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 398 28 FrontBoardServices 0x00007fff25a43e55 94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.176 + 102 29 FrontBoardServices 0x00007fff25a28f12 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 209 30 FrontBoardServices 0x00007fff25a43b28 94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke + 352 31 libdispatch.dylib 0x000000011073474e _dispatch_client_callout + 8 32 libdispatch.dylib 0x0000000110737656 _dispatch_block_invoke_direct + 295 33 FrontBoardServices 0x00007fff25a695d0 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 30 34 FrontBoardServices 0x00007fff25a692b6 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 433 35 FrontBoardServices 0x00007fff25a6977b -[FBSSerialQueue _performNextFromRunLoopSource] + 22 36 CoreFoundation 0x00007fff20390ede CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 37 CoreFoundation 0x00007fff20390dd6 CFRunLoopDoSource0 + 180 38 CoreFoundation 0x00007fff2039029e CFRunLoopDoSources0 + 242 39 CoreFoundation 0x00007fff2038a9f7 __CFRunLoopRun + 875 40 CoreFoundation 0x00007fff2038a1a7 CFRunLoopRunSpecific + 567 41 GraphicsServices 0x00007fff2b874d85 GSEventRunModal + 139 42 UIKitCore 0x00007fff246c14df -[UIApplication _run] + 912 43 UIKitCore 0x00007fff246c639c UIApplicationMain + 101 44 Runner 0x000000010b8a32bb main + 75 45 libdyld.dylib 0x00007fff2025abbd start + 1 46 ??? 0x0000000000000001 0x0 + 1 ) libc++abi: terminating with uncaught exception of type NSException *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[OneSignal initWithLaunchOptions:]: unrecognized selector sent to class 0x10ba45368' terminating with uncaught exception of type NSException CoreSimulator 757.5 - Device: iPhone 12 Pro (7570E4CA-D1EA-4FA8-A64D-B1DC9387AA54) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone 12 Pro

Migration was made due to official migration guide. Had to revert to v2.6.4

omar14 commented 3 years ago

I had this issue after migrating, try to update the podfile OneSignalNotificationServiceExtension target to this:

target 'OneSignalNotificationServiceExtension' do
  use_frameworks!
  pod 'OneSignal', '>= 3.4.3', '< 4.0'
end

I changed it and ran pos install again, and the crash was gone

Trteich commented 3 years ago

Thanks a lot. It helped me