ricardoalcocer / actionbarextras

Titanium Android Native Module that exposes ActionBar features not exposed by the Titanium SDK
MIT License
149 stars 60 forks source link

menuhandling crashes app #109

Closed AppWerft closed 7 years ago

AppWerft commented 7 years ago

Hi Manu, this simole code crashes my app. The evil item is menu.add:

win.addEventListener("open", function(e) {
    abx.window = win;
    win.activity.actionBar.displayHomeAsUp = true;
    win.activity.actionBar.onHomeIconItemSelected = function(_e) {
        win.close();
    };
    win.activity.onCreateOptionsMenu = function(e) {
        e.menu.clear();
        e.menu.add({
            title : 'Search',
            icon : Ti.Android.R.drawable.ic_menu_search,
            showAsAction : Ti.Android.SHOW_AS_ACTION_IF_ROOM,
        });
    };
});
[ERROR] :  dalvikvm: Could not find class 'android.support.v7.view.menu.MenuItemWrapperICS', referenced from method org.appcelerator.titanium.proxy.MenuProxy.findItem
[WARN] :   dalvikvm: VFY: unable to resolve instanceof 1598 (Landroid/support/v7/view/menu/MenuItemWrapperICS;) in Lorg/appcelerator/titanium/proxy/MenuProxy;
[DEBUG] :  dalvikvm: VFY: replacing opcode 0x20 at 0x0000
[ERROR] :  dalvikvm: Could not find class 'android.support.v7.view.menu.MenuItemWrapperICS', referenced from method org.appcelerator.titanium.proxy.MenuProxy.handleAdd
[WARN] :   dalvikvm: VFY: unable to resolve instanceof 1598 (Landroid/support/v7/view/menu/MenuItemWrapperICS;) in Lorg/appcelerator/titanium/proxy/MenuProxy;
[DEBUG] :  dalvikvm: VFY: replacing opcode 0x20 at 0x0049
[ERROR] :  dalvikvm: Could not find class 'android.support.v7.view.menu.MenuItemWrapperICS', referenced from method org.appcelerator.titanium.proxy.MenuProxy.handleRemoveGroup
[WARN] :   dalvikvm: VFY: unable to resolve instanceof 1598 (Landroid/support/v7/view/menu/MenuItemWrapperICS;) in Lorg/appcelerator/titanium/proxy/MenuProxy;
[DEBUG] :  dalvikvm: VFY: replacing opcode 0x20 at 0x0022
[ERROR] :  dalvikvm: Could not find class 'android.support.v7.view.menu.MenuItemWrapperICS', referenced from method org.appcelerator.titanium.proxy.MenuProxy.handleRemoveItem
[WARN] :   dalvikvm: VFY: unable to resolve instanceof 1598 (Landroid/support/v7/view/menu/MenuItemWrapperICS;) in Lorg/appcelerator/titanium/proxy/MenuProxy;
[DEBUG] :  dalvikvm: VFY: replacing opcode 0x20 at 0x000b
[WARN] :   TiRHelper: (KrollRuntimeThread) [868,868] Using android.R.drawable is not recommended since they are changed/removed across Android versions. Instead copy images to res folder.
[DEBUG] :  AndroidRuntime: Shutting down VM
[WARN] :   dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41a05da0)
[ERROR] :  TiApplication: (main) [51,919] Sending event: exception on thread: main msg:java.lang.NoClassDefFoundError: android.support.v7.view.menu.MenuItemWrapperICS; Titanium 1.0.0,2016/02/25 19:58,HEAD
[ERROR] :  TiApplication: java.lang.NoClassDefFoundError: android.support.v7.view.menu.MenuItemWrapperICS
AppWerft commented 7 years ago

Found: was 5.2.0, now with 5.5.0.GA it works! Sorry for noise.