privacy-screen icon indicating copy to clipboard operation
privacy-screen copied to clipboard

bug: runtime error: `application tried to present modal view controller on itself`

Open tafelnl opened this issue 1 year ago • 7 comments

Plugin version: v4.2.3

Platform(s): iOS

Steps to reproduce:

  1. just keep the default config
  2. swipe from the bottom so that the App Switcher opens
  3. click on the app, so that it opens again
  4. immediately and quickly (this is important) swipe up from the bottom so that the App Switcher opens
  5. do this a few times until the said error occurs

I know this is not an ideal reproduction. But I cannot find a consistent/simple way to reproduce this instead. Mostly it happens after trying step 2,3,4 like 2-5 times though

tafelnl avatar Mar 06 '24 10:03 tafelnl

Does the problem still exist with the latest version?

robingenz avatar Mar 08 '24 07:03 robingenz

Unfortunately, yes

tafelnl avatar Mar 08 '24 07:03 tafelnl

I can confirm this issue - we have exactly the same problem. After downgrading to 4.2.2, the crashes are gone.

micbis avatar Apr 19 '24 07:04 micbis

PRs are welcome.

robingenz avatar Apr 19 '24 08:04 robingenz

Posso confirmar este problema - temos exatamente o mesmo problema. Após o downgrade para 4.2.2, as falhas desapareceram.

colidir

@micbis Hello friend, everything okay? I hope so. Can I ask a question? How do you know it's this plugin that caused the error? I'm also having this error in this topic, but I couldn't reach a conclusion that it was this problem. I'm just curious, but I'm dealing with the same problem.

andrerds avatar Apr 23 '24 19:04 andrerds

Posso confirmar este problema - temos exatamente o mesmo problema. Após o downgrade para 4.2.2, as falhas desapareceram. colidir

@micbis Hello friend, everything okay? I hope so. Can I ask a question? How do you know it's this plugin that caused the error? I'm also having this error in this topic, but I couldn't reach a conclusion that it was this problem. I'm just curious, but I'm dealing with the same problem.

Friend, I asked because the errors that appear to me point directly to the plugin. See the image below.

Captura de Tela 2024-04-24 às 09 22 27

Other errors have a similar description but don't directly show which file. Look at the image below, it's quite similar to the shared error.

edit

I'm not sure if both errors are related. Do you think they might be related?

Regarding the plugin, I'm still on version 4.0.0. I need to update. Another thing is that I couldn't replicate the problem. I see I have the logs, but I can't reproduce it, and even worse, I don't know the impact on the application—whether it crashes, freezes, or sets off fireworks, haha.

Thank

andrerds avatar Apr 24 '24 12:04 andrerds

I can confirm the crash is caused by the plugin. As far as I can tell, the plugin tries to display the privacyViewController multiple if handleWillResignActiveNotification is called multiple times by the OS.

7-plus-t avatar May 24 '24 06:05 7-plus-t

@7-plus-t Would you be willing to create a PR?

robingenz avatar May 24 '24 06:05 robingenz

@robingenz done, see https://github.com/capacitor-community/privacy-screen/pull/93

7-plus-t avatar Jun 28 '24 14:06 7-plus-t