Crashes on Android targetSdkVersion=23
andersdp opened this issue · 9 comments
Drawer works fine in simulator when testing with Android 6.0 (Marshmallow) and targetSdkVersion=23 but doing the same on a device the app crashes during startup. And due to a bug in the titanium SDK the console shows no output: https://jira.appcelerator.org/browse/TIMOB-19821 so it's kind of hard to know whats going on.
Does the module need to be build against Android 6.0?
I would recommend using Ti.DrawerLayout for android. Its more stable and maintained.
https://github.com/manumaticx/Ti.DrawerLayout
It fails for me too:
[ERROR] : TiApplication: Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
[ERROR] : TiApplication: at android.view.ViewGroup.addViewInner(ViewGroup.java:3937)
[ERROR] : TiApplication: at android.view.ViewGroup.addView(ViewGroup.java:3787)
[ERROR] : TiApplication: at android.view.ViewGroup.addView(ViewGroup.java:3759)
[ERROR] : TiApplication: at dk.napp.drawer.Drawer.processProperties(Drawer.java:365)
Is there any chance for a fixed version? Is it perhaps only a matter of recompiling for current versions of Appcelerator and Android?
+1
Would be great to have this fixed, here's the error I am getting:
[ERROR] : TiApplication: (main) [607,711] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getWidth()' on a null object reference; Titanium 5.2.1,2016/03/18 22:51,23e1c7d
[ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getWidth()' on a null object reference
[ERROR] : TiApplication: at com.slidingmenu.lib.CustomViewBehind.getSecondaryBehindWidth(CustomViewBehind.java:80)
[ERROR] : TiApplication: at com.slidingmenu.lib.CustomViewBehind.scrollBehindTo(CustomViewBehind.java:251)
[ERROR] : TiApplication: at com.slidingmenu.lib.CustomViewAbove.scrollTo(CustomViewAbove.java:806)
[ERROR] : TiApplication: at com.slidingmenu.lib.CustomViewAbove.onSizeChanged(CustomViewAbove.java:468)
[ERROR] : TiApplication: at android.view.View.sizeChange(View.java:16748)
[ERROR] : TiApplication: at android.view.View.setFrame(View.java:16710)
[ERROR] : TiApplication: at android.view.View.layout(View.java:16627)
[ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:5437)
[ERROR] : TiApplication: at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
[ERROR] : TiApplication: at android.view.View.layout(View.java:16630)
[ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:5437)
[ERROR] : TiApplication: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
[ERROR] : TiApplication: at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
[ERROR] : TiApplication: at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
[ERROR] : TiApplication: at android.view.View.layout(View.java:16630)
[ERROR] : TiApplication: at android.view.ViewGroup.layout(ViewGroup.java:5437)
[ERROR] : TiApplication: at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171)
[ERROR] : TiApplication: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931)
[ERROR] : TiApplication: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
[ERROR] : TiApplication: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
[ERROR] : TiApplication: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
[ERROR] : TiApplication: at android.view.Choreographer.doCallbacks(Choreographer.java:670)
[ERROR] : TiApplication: at android.view.Choreographer.doFrame(Choreographer.java:606)
[ERROR] : TiApplication: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
[ERROR] : TiApplication: at android.os.Handler.handleCallback(Handler.java:739)
[ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:95)
[ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:148)
[ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5417)
[ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Little bit more info with regards to my error, is that it stops happening if I define leftWindow, but actually I only want it to open from the right. Any ideas @viezel
Still occurring with 1.1.7 update.
Any update regarding this issue. I m facing the same issue of getwidth(). @viezel any updates please.
The rightWindow has been broken since 1.1.3 and when you set it it just causes the app to crash - as soon as you revert to leftWindow it works fine
Aaaarhhhh, i finished my app on ios and know when testing on android, i have same issue, any fix found by someone else? i start to asks myself if using titanium is not a waste of time because i should now re-code all my app for both platform