Android Question API 35 + AppCompat Menu = Crash on open

RichardN

Well-Known Member
Licensed User
Longtime User
I have a legacy single activity project that uses the AppCompat menu. I have employed the manifest text suggested by @Erel to suppress the edge-to-edge behaviour that comes with API35.

When compiled and installed the app crashes on open with no outputs to the logs (filtered or otherwise)..... which leads me to think the manifest text is the problem. All libraries are up to date and I have removed other manifest adjustments.

This is the manifest I am using. My original text is commented out and that suggested by @Erel is added. I have tried a number of combinations but the app crashes on open every time. Suggestions?

Manifest:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="35"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

'Original Manifest text follows:

'AddApplicationText(
'<meta-data android:name="com.samsung.android.icon_container.has_icon_container" android:value="true"/>
')

'SetApplicationAttribute(android:theme, "@style/MyAppTheme")
'
'CreateResource(values, theme.xml,
'<resources>
'    <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
'        <item name="colorPrimary">#0098FF</item>
'        <item name="colorPrimaryDark">#007CF5</item>
'        <item name="colorAccent">#AAAA00</item>
'        <item name="windowNoTitle">true</item>
'        <item name="windowActionBar">false</item>
'    </style>
'</resources>
')


'New Manifest adjustment as suggested by @Erel

SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, theme.xml,
<resources>
    <style
        name="LightTheme" parent="@android:style/Theme.Material.Light">
       <item name="android:actionMenuTextAppearance">@style/LowerCaseMenu</item>
       <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
    </style>
     <style name="LowerCaseMenu" parent="android:TextAppearance.Material.Widget.ActionBar.Menu">
        <item name="android:textAllCaps">false</item>
    </style>
</resources>
)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

There must be an error message when the app crashes.
 
Upvote 0

RichardN

Well-Known Member
Licensed User
Longtime User
@Erel... As I stated above, there was no error message in logs, unfiltered or otherwise. After 2 crashes on installation the device prompted me to seek an updated version from the author..... so no error clues whatsoever.

The first manifest entry you suggested HERE that opts out of edge-to-edge display I believe was the cause. The new manifest that you have just appended to the AppCompat example above, now works perfectly. Many thanks.
 
Upvote 0
Top