Capacitor.Plugins.App.getInfo sometimes does not complete (resolve/reject)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- mobile-dev
Research direction
Start with AppPlugin.java and trace how getInfo resolves through postMessage on the androidBridge to JavaScript. Run the linked capacitor-android-reload reproduction and compare Android devices and emulators where the promise stops completing. Done means getInfo consistently resolves or rejects during the reload scenario.
Written by the indexing model from the issue text.
Description
Bug Report
Plugin(s)
App
Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 8.1.0
@capacitor/core: 8.1.0
@capacitor/android: 8.1.0
@capacitor/ios: 8.1.0
Installed Dependencies:
@capacitor/ios: not installed
@capacitor/cli: 8.1.0
@capacitor/android: 8.1.0
@capacitor/core: 8.1.0
[success] Android looking great! 👌
Platform(s)
Android
On physical devices, I was able to reproduce this on a Pixel 2XL running Android 11, but not on a Pixel 8A or Nothing Phone 1 running Android 14.
However, on Android Studio emulators, I was able to reproduce it on emulators running Android 13, 14 and 15.
Current Behavior
Calling Capacitor.Plugins.App.getInfo() during the DOMContentLoaded event of the index page sometimes does not resolve (nor reject), the promise simply never completes at all.
Expected Behavior
The getInfo function should either resolve or reject.
Code Reproduction
https://github.com/Mottschi/capacitor-android-reload
This example app will automatically reload until the issue is encountered, incrementing a counter to show progress. When the bug occurs, the reloads and counter incrementation will simply stop. Observed frequency the issue occurred was different depending on the device/emulator used, but generally, on the devices where it occurs, it happens the first time within about the first 100 reloads.
Other Technical Details
We did some debugging when we encountered this in our app. From what we were able to tell, the getInfo method in AppPlugin.java is called and resolves normally in these cases, but the result seems to be getting lost when being sent with postMessage through the androidBridge to JS.
Additional Context
- Dominant language
- Java
- Stars
- 678
- Forks
- 688
- Avg merge
- 5d 11h
- Merged PRs (30d)
- 3
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ionic-team/capacitor-plugins
-
[@capacitor/app] iOS: 'Expression implicitly coerced from String? to Any' warning in getAppLanguageOpentriage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
ionic-team/capacitor-plugins#2604 ·
-
platform: ios
Difficulty 4/5 3-5 days Newbie friendliness 58/100
ionic-team/capacitor-plugins#2603 · 1 comment ·
-
platform: android
Difficulty 3/5 1-2 days Newbie friendliness 76/100
ionic-team/capacitor-plugins#2599 ·
-
platform: ios
Difficulty 3/5 1-2 days Newbie friendliness 68/100
ionic-team/capacitor-plugins#2595 · 1 reaction ·
-
platform: android triage
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ionic-team/capacitor-plugins#2593 ·
All issues in ionic-team/capacitor-plugins
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
apache/arrow-java#1311 ·
Maintainers usually reply within 2 days
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
IBM/networking-java-sdk#204 ·
-
bug Technical Debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
avniproject/avni-server#1080 ·