Describe the bug
After upgrading to Capacitor 8.5.2, the AdMob banner can have incorrect safe-area behavior depending on the Android version and Android System WebView version.
The issue can be reproduced with the standard adaptive banner configuration:
await AdMob.showBanner({
adId: BANNER_AD_UNIT_ID,
adSize: BannerAdSize.ADAPTIVE_BANNER,
position: BannerAdPosition.BOTTOM_CENTER,
isTesting: true,
});
This appears to be related to the safe-area / edge-to-edge changes introduced in Capacitor 8.5.2.
Capacitor 8.5.2 requirement
With Capacitor 8.5.2, EdgeToEdge.enable(this) also needs to be added to MainActivity:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
}
Without this configuration, the application can have unexpected safe-area behavior.
The reproduction project already includes the required configuration and is ready to run:
https://github.com/luisbytes/admob-safearea-community
Capacitor 9
This is also relevant for Capacitor 9.
The Capacitor 9 changes that make edge-to-edge the default in the Android starter template and update the migration path for existing projects are already merged into next:
These changes make EdgeToEdge.enable(this) part of the Android MainActivity template and update existing projects to the new edge-to-edge configuration.
However, this issue should also be patched for Capacitor 8.5.2+ and not be deferred until Capacitor 9. Projects using Capacitor 8.5.2 or later are already affected by this behavior today.
Because of this, it would be useful for @capacitor-community/admob to provide a fix for the current Capacitor 8.5.2+ behavior while also ensuring compatibility with the Capacitor 9 changes.
To Reproduce
- Open the reproduction project:
https://github.com/luisbytes/admob-safearea-community
- Install the dependencies and run the Android application.
- The project is already configured with Capacitor
8.5.2 and the required EdgeToEdge.enable(this) configuration.
- Test the application using different Android System WebView versions.
- Observe the position of the bottom adaptive AdMob banner.
The following behavior can be reproduced:
| Android |
WebView |
Result |
Screenshot |
| Android <= 14 |
WebView < 140 |
Works |
 |
| Android <= 14 |
WebView >= 140 |
Banner is behind the navigation bar |
 |
| Android >= 15 |
WebView < 140 |
Double safe-area padding |
 |
| Android >= 15 |
WebView >= 140 |
Works |
 |
Expected behavior
The banner should always be positioned correctly above the Android navigation/gesture area without being covered or receiving the safe-area inset twice, regardless of the Android System WebView version.
Smartphone
- OS: Android 14 / Android 16
- WebView: 113 / 134 / 153
- Capacitor: 8.5.2
- AdMob:
@capacitor-community/admob
- Ad size:
BannerAdSize.ADAPTIVE_BANNER
- Position:
BannerAdPosition.BOTTOM_CENTER
- Testing:
true
Additional context
The important factor appears to be the Android System WebView version, rather than Android version alone.
The issue appears to be related to the safe-area / edge-to-edge refactor introduced in Capacitor 8.5.2 (ionic-team/capacitor#8535).
It would be good to address this in the current Capacitor 8 line rather than waiting for Capacitor 9, because applications using Capacitor 8.5.2+ can already encounter this issue depending on their Android System WebView version.
Describe the bug
After upgrading to Capacitor 8.5.2, the AdMob banner can have incorrect safe-area behavior depending on the Android version and Android System WebView version.
The issue can be reproduced with the standard adaptive banner configuration:
This appears to be related to the safe-area / edge-to-edge changes introduced in Capacitor 8.5.2.
Capacitor 8.5.2 requirement
With Capacitor 8.5.2,
EdgeToEdge.enable(this)also needs to be added toMainActivity:Without this configuration, the application can have unexpected safe-area behavior.
The reproduction project already includes the required configuration and is ready to run:
https://github.com/luisbytes/admob-safearea-community
Capacitor 9
This is also relevant for Capacitor 9.
The Capacitor 9 changes that make edge-to-edge the default in the Android starter template and update the migration path for existing projects are already merged into
next:These changes make
EdgeToEdge.enable(this)part of the AndroidMainActivitytemplate and update existing projects to the new edge-to-edge configuration.However, this issue should also be patched for Capacitor 8.5.2+ and not be deferred until Capacitor 9. Projects using Capacitor 8.5.2 or later are already affected by this behavior today.
Because of this, it would be useful for
@capacitor-community/admobto provide a fix for the current Capacitor 8.5.2+ behavior while also ensuring compatibility with the Capacitor 9 changes.To Reproduce
https://github.com/luisbytes/admob-safearea-community
8.5.2and the requiredEdgeToEdge.enable(this)configuration.The following behavior can be reproduced:
Expected behavior
The banner should always be positioned correctly above the Android navigation/gesture area without being covered or receiving the safe-area inset twice, regardless of the Android System WebView version.
Smartphone
@capacitor-community/admobBannerAdSize.ADAPTIVE_BANNERBannerAdPosition.BOTTOM_CENTERtrueAdditional context
The important factor appears to be the Android System WebView version, rather than Android version alone.
The issue appears to be related to the safe-area / edge-to-edge refactor introduced in Capacitor 8.5.2 (ionic-team/capacitor#8535).
It would be good to address this in the current Capacitor 8 line rather than waiting for Capacitor 9, because applications using Capacitor 8.5.2+ can already encounter this issue depending on their Android System WebView version.