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

bug: Application tried to present modally a view controller <UIViewController: 0x10392e710> that is already being presented by <Capacitor.CAPBridgeViewController: 0x10390bf60>. #83

Closed
qliqdev opened this issue Nov 20, 2023 · 3 comments

Comments

@qliqdev
Copy link
Contributor

qliqdev commented Nov 20, 2023

Plugin version: 4.2.1

Platform(s): iOS

Current behavior:

App crashes

Expected behavior:

Steps to reproduce:

Seeing this crash log in crashlytics

Related code:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                     0xed5e0 __exceptionPreprocess
1  libobjc.A.dylib                    0x2bc00 objc_exception_throw
2  UIKitCore                          0x7795f8 -[UIViewController _presentViewController:withAnimationController:completion:]
3  UIKitCore                          0x779d64 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke_2
4  UIKitCore                          0x42218 +[UIView(Animation) performWithoutAnimation:]
5  UIKitCore                          0x779ce4 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke
6  UIKitCore                          0x779f6c -[UIViewController _performCoordinatedPresentOrDismiss:animated:]
7  UIKitCore                          0x779bd8 -[UIViewController _presentViewController:animated:completion:]
8  UIKitCore                          0x77a028 -[UIViewController presentViewController:animated:completion:]
9  CapacitorCommunityPrivacyScreen    0x4b08 closure #1 in PrivacyScreen.handleWillResignActiveNotification() + 44 (PrivacyScreen.swift:44)
10 CapacitorCommunityPrivacyScreen    0x41b4 thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
11 libdispatch.dylib                  0x26a8 _dispatch_call_block_and_release
12 libdispatch.dylib                  0x4300 _dispatch_client_callout
13 libdispatch.dylib                  0x12998 _dispatch_main_queue_drain
14 libdispatch.dylib                  0x125b0 _dispatch_main_queue_callback_4CF
15 CoreFoundation                     0x379bc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
16 CoreFoundation                     0x346c8 __CFRunLoopRun
17 CoreFoundation                     0x33e18 CFRunLoopRunSpecific
18 GraphicsServices                   0x35ec GSEventRunModal
19 UIKitCore                          0x22f2fc -[UIApplication _run]
20 UIKitCore                          0x22e938 UIApplicationMain
21 Bakai24                            0x93f8 main + 7 (AppDelegate.swift:7)
22 ???                                0x1b4277d44 (Missing)

Other information:

Device Model:iPhone 14 Pro
Operating System Version:17.0.3

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

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

Installed Dependencies:

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

[success] iOS looking great! 👌
[success] Android looking great! 👌
@qliqdev
Copy link
Contributor Author

qliqdev commented Nov 20, 2023

can it be fixed with code below?

@objc public func handleWillResignActiveNotification() {
    guard self.isEnabled, !self.privacyViewController.isBeingPresented else {
        return
    }
    DispatchQueue.main.async {
        self.plugin.bridge?.viewController?.present(self.privacyViewController, animated: false, completion: nil)
    }
}

@robingenz
Copy link
Member

Does the problem still exist with the latest version?

Copy link

github-actions bot commented Apr 8, 2024

It looks like there hasn't been a reply in 30 days, so I'm closing this issue.

@github-actions github-actions bot closed this as completed Apr 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2024
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

2 participants