ionic-team / ionic-team/capacitor-plugins

Capacitor.Plugins.App.getInfo sometimes does not complete (resolve/reject)

Open
#2,278 6 comments 0 reactions 0 assignees View on GitHub
needs reproduction platform: android
Dominant language
Java
Stars
678
Forks
685
Avg merge
4d 22h
Merged PRs (30d)
3

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.