-
Notifications
You must be signed in to change notification settings - Fork 23
Description
After upgrading from Delphi 12 to Delphi 13, an FMX Android app crashes on some devices running Android 10 (API 29) or older. The crash happens on startup (or as soon as window insets are applied) with:
java.lang.NoSuchMethodError: No static method systemBars()I in class android.view.WindowInsets$Type
The stack trace points to FireMonkey Java code:
com.embarcadero.firemonkey.form.FormView$1.onApplyWindowInsets(FormView.java:31)
This method appears to call WindowInsets.Type.systemBars() which is API 30+, causing NoSuchMethodError on Android 10 and below (depending on device/ROM restrictions).
Affected versions
Works on: Delphi 12 (same app / same code)
Fails on: Delphi 13 (same app / same code)
Android versions affected: Android 10 (API 29) and below (observed on some older devices; on newer Android versions it works)
Steps to reproduce (minimal)
Create a new blank FMX Android application.
Add a unit in uses that (directly or indirectly) causes an OnApplyWindowInsets listener to be used (example: a “system bars” helper library that calls setOnApplyWindowInsetsListener or registers an FMX platform service related to system bars/insets).
Build & install with Delphi 13.
Run on an Android 10 (API 29) device.
Result: App crashes immediately with NoSuchMethodError in FormView.java:31.
Expected: App should not crash; insets handling should use API-compatible methods for Android 10 and older (e.g., legacy insets APIs / guards by SDK_INT).