Skip to content
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

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

Closed
gultyayev opened this issue Sep 7, 2021 · 7 comments

Comments

@gultyayev
Copy link

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

@Ionitron
Copy link
Collaborator

Ionitron commented Sep 7, 2021

This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue.

Please see the Contributing Guide for how to create a Code Reproduction.

Thanks!
Ionitron 💙

@gultyayev
Copy link
Author

Didn't manage to create a code reproduction, but managed to narrow down search to @ionic-enterprise/identity-vault. As soon as this plugin gets removed no problems with iOS simulator

@armespavong
Copy link

I've been facing the exact same issue, not just on iOS emulator but also on Android. This has happened after I removed and added platforms again because I had some other issue. Before, I thought it was because I updated dependencies for Capacitors but then I tried downgraded them and the issue still exists.

When I commented the push notification parts in my code, everything works fine.
(I didn't use @ionic-enterprise/identity-vault in my project)

@gultyayev
Copy link
Author

Well, for me it's purely the vault. And what's interesting even if I don't use it the app crashes. Only when I delete the plugin from packages it starts working. No issues with the Android emulators.

It looks like on the iOS it tries to reach to some kind of API/View which isn't included there

@armespavong
Copy link

For Android I just figured it out that changing the version of com.google.gms:google-services in build.gradle (project-level) from 4.3.10 back to 4.3.5 solved the issue.

And for iOS it was from another issue which coincidentally made me assume it was form the same issue. My bad 😁

@jcesarmobile
Copy link
Member

This is a bug in identity vault, has been fixed, will be available on next release of the plugin.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants