Skip to content

[DevicePlugin] unrecognized selector sent to instance... crashes app on iOS emulators only #598

@gultyayev

Description

@gultyayev

Bug Report

Plugin(s)

"@capacitor/device": "^1.0.3"

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 3.2.2
  @capacitor/core: 3.2.2
  @capacitor/android: 3.2.2
  @capacitor/ios: 3.2.2

Installed Dependencies:

  @capacitor/cli: 3.2.2
  @capacitor/core: 3.2.2
  @capacitor/android: 3.2.2
  @capacitor/ios: 3.2.2

[success] iOS looking great! 👌
[success] Android looking great! 👌

Platform(s)

iOS simulator

Current Behavior

On simulators app launches, black screen is shown for a while and then app is closed.
Interestingly when app is opened through XCode's build it works, then if I close the app debugger detaches and then if I open the app by clicking on the icon on the simulator the issue is observed.

Expected Behavior

It should work.

Code Reproduction

It's not clear to me what causes this issue

Other Technical Details

There is a bit of logs that I managed to gather with Console

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DevicePlugin initWithWebViewEngine:]: unrecognized selector sent to instance 0x600002a472a0'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 732.18.6 - Device: iPhone 12 (********-****-****-****-************) - Runtime: iOS 14.4 (18D46) - DeviceType: iPhone 12

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff20421af6 __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff20177e78 objc_exception_throw + 48
2   CoreFoundation                      0x00007fff204306f7 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3   CoreFoundation                      0x00007fff20426036 ___forwarding___ + 1489
4   CoreFoundation                      0x00007fff20428068 _CF_forwarding_prep_0 + 120
5   Cordova                             0x0000000100a515b0 -[CDVPluginManager getCommandInstance:] + 368
6   Capacitor                           0x0000000100802fe7 $s9Capacitor0A6BridgeC22registerCordovaPluginsyyF + 1431
7   Capacitor                           0x00000001007ff8ba $s9Capacitor0A6BridgeC25setupCordovaCompatibilityyyF + 122
8   Capacitor                           0x00000001007fe53f $s9Capacitor0A6BridgeC4with8delegate20cordovaConfiguration12assetHandler010delegationH0ACSo011CAPInstanceF0C_AA17CAPBridgeDelegate_pSo15CDVConfigParserCAA012WebViewAssetH0CAA0op10DelegationH0Ctcfc + 4255
9   Capacitor                           0x00000001007fd48a $s9Capacitor0A6BridgeC4with8delegate20cordovaConfiguration12assetHandler010delegationH0ACSo011CAPInstanceF0C_AA17CAPBridgeDelegate_pSo15CDVConfigParserCAA012WebViewAssetH0CAA0op10DelegationH0CtcfC + 74
10  Capacitor                           0x000000010081787c $s9Capacitor23CAPBridgeViewControllerC04loadC0yyF + 1324
11  Capacitor                           0x00000001008199fb $s9Capacitor23CAPBridgeViewControllerC04loadC0yyFTo + 43
12  UIKitCore                           0x00007fff23f62947 -[UIViewController loadViewIfRequired] + 172
13  UIKitCore                           0x00007fff23f630c1 -[UIViewController view] + 27
14  UIKitCore                           0x00007fff246d57f3 -[UIWindow addRootViewControllerViewIfPossible] + 313
15  UIKitCore                           0x00007fff246d4ee1 -[UIWindow _updateLayerOrderingAndSetLayerHidden:actionBlock:] + 219
16  UIKitCore                           0x00007fff246d5ea5 -[UIWindow _setHidden:forced:] + 362
17  UIKitCore                           0x00007fff246e8ef8 -[UIWindow _mainQueue_makeKeyAndVisible] + 42
18  UIKitCore                           0x00007fff24694c3a -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 4138
19  UIKitCore                           0x00007fff2469a56d -[UIApplication _runWithMainScene:transitionContext:completion:] + 1237
20  UIKitCore                           0x00007fff23cc36f7 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122
21  UIKitCore                           0x00007fff24251d1e _UIScenePerformActionsWithLifecycleActionMask + 88
22  UIKitCore                           0x00007fff23cc4206 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198
23  UIKitCore                           0x00007fff23cc3cca -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 474
24  UIKitCore                           0x00007fff23cc4037 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 819
25  UIKitCore                           0x00007fff23cc38cb -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345
26  UIKitCore                           0x00007fff23ccbb63 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 178

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions