Android Question "AX_CustomAlertViewDialog incompatibility with B4A v13.40 (SDK 35/36) and AppCompatActivity"

softmicro

Member
Licensed User
Longtime User
Hello everyone,

I'm encountering a significant compatibility issue with the AX_CustomAlertViewDialog library since upgrading my B4A environment to version 13.40, which supports SDK 35/36. I've installed the latest command-line tools (commandlinetools-win-13114758_latest.zip) and updated all required resources (7_25) to be up-to-date with Google Play Store requirements.

While most of my projects and other examples compile and run correctly with this new setup, I have one specific application that relies heavily on AX_CustomAlertViewDialog and is now completely non-functional.

The core of the problem seems to be related to the #Extends: androidx.appcompat.app.AppCompatActivity line in combination with the library's resource inclusion (#AdditionalRes: ..\resAX_CustomAlertViewDialog).

Specifically:

  • When #Extends: androidx.appcompat.app.AppCompatActivity is present, the compiled application crashes immediately upon launch, providing no useful error logs in the B4A IDE regarding the startup failure. Even a simple example from 2020 that uses this library exhibits the same behavior.
  • If I comment out the #Extends: androidx.appcompat.app.AppCompatActivity line, the application does launch. However, as soon as any action triggers the AX_CustomAlertViewDialog, I receive the following ClassCastException:
    main_inputdialog_click (java line: 684)
    java.lang.ClassCastException: com.aghajari.ax_customalertviewdialog.sample.main cannot be cast To androidx.appcompat.app.AppCompatActivity
    at stream.customalert.CustomAlertDialogue.show(CustomAlertDialogue.java:580)

    This error is expected, as removing the #Extends line obviously breaks the necessary inheritance for the library to function correctly, leading back to the original problem where the app cannot even start.
It appears there's a fundamental incompatibility or a required update needed for the AX_CustomAlertViewDialog library to work correctly with the latest SDK versions (35/36) and the androidx.appcompat.app.AppCompatActivity extension.

Given that this library is widely used, I believe this is an important issue for the community. Has anyone else encountered this specific problem?

@Erel, or @Aghajari (the creator of the library), could you please provide some guidance on how to resolve this? Is an update to the library necessary, or is there a workaround that allows androidx.appcompat.app.AppCompatActivity to coexist with the library's current implementation under SDK 35/36?

Thank you for your time and assistance.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top