[TIMOB-25481] Placing Hyperloop WebViews on ScrollableView crashes the app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Hyperloop |
Labels | n/a |
Reporter | AppDev |
Assignee | Unknown |
Created | 2017-08-15T06:28:05.000+0000 |
Updated | 2018-02-28T19:55:38.000+0000 |
Description
If you place several single hyperloop WebViews (5 pages with 1 WebView each works well to provoke the crash) on an Titanium ScrollableView you get an app crash when navigating through the pages.
The crash log:
[ERROR] : TiApplication: (main) [211276,212482] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.kroll.KrollDict.containsKey(java.lang.Object)' on a null object reference; Titanium 6.1.2,2017/07/27 16:09,undefined
[ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.kroll.KrollDict.containsKey(java.lang.Object)' on a null object reference
[ERROR] : TiApplication: at org.appcelerator.kroll.KrollProxy.hasProperty(KrollProxy.java:531)
[ERROR] : TiApplication: at org.appcelerator.titanium.view.TiUIView.setNativeView(TiUIView.java:338)
[ERROR] : TiApplication: at hyperloop.HyperloopView.<init>(HyperloopView.java:49)
[ERROR] : TiApplication: at hyperloop.InstanceProxy.createView(InstanceProxy.java:80)
[ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:496)
[ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:482)
[ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:520)
[ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:504)
[ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:482)
[ERROR] : TiApplication: at ti.modules.titanium.ui.widget.TiUIScrollableView$ViewPagerAdapter.instantiateItem(TiUIScrollableView.java:580)
[ERROR] : TiApplication: at android.support.v4.view.PagerAdapter.instantiateItem(PagerAdapter.java:111)
[ERROR] : TiApplication: at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:943)
[ERROR] : TiApplication: at android.support.v4.view.ViewPager.populate(ViewPager.java:1125)
[ERROR] : TiApplication: at android.support.v4.view.ViewPager.populate(ViewPager.java:1025)
[ERROR] : TiApplication: at android.support.v4.view.ViewPager$3.run(ViewPager.java:254)
[ERROR] : TiApplication: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:800)
[ERROR] : TiApplication: at android.view.Choreographer.doCallbacks(Choreographer.java:603)
[ERROR] : TiApplication: at android.view.Choreographer.doFrame(Choreographer.java:571)
[ERROR] : TiApplication: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:786)
[ERROR] : TiApplication: at android.os.Handler.handleCallback(Handler.java:815)
[ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:104)
[ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:194)
[ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5576)
[ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method)
[ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Method.java:372)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:956)
[ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:751)
Looking at the errors it looks like it wants to get the
touchEnabled
property in this line: https://github.com/appcelerator/titanium_mobile/blob/220d265f74535bc2bc15a7a79362f5673591a8cf/android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java#L338 which calls hasProperty here: https://github.com/appcelerator/titanium_mobile/blob/6_1_X/android/titanium/src/java/org/appcelerator/kroll/KrollProxy.java#L531 butproperties
is null (released?). So what you could try as a workaround is to increase thecacheSize
of the ScrollableView so it doesn't remove the Hyperloop views.Thank you for having a look! This is what we are ultimately doing and it indeed helped to migitate this issue, but now we need to do the cache management ourselves because it is impacting the ScrollableView's performance. It would be really nice if this could be fixed upstream (add a check for null there?).
Hello [~AppDev], is your issue resolved? Can you provide a update on the latest sdk build? Thanks.
@Sharif AbuDarda Did you change anything relevant for this issue?
Not fixed for us on SDK 6.3.0.GA: [ERROR] : TiApplication: (main) [237037,263102] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.kroll.KrollDict.containsKey(java.lang.Object)' on a null object reference; Titanium 6.3.0,2017/10/31 18:13,undefined [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.kroll.KrollDict.containsKey(java.lang.Object)' on a null object reference [ERROR] : TiApplication: at org.appcelerator.kroll.KrollProxy.hasProperty(KrollProxy.java:580) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiUIView.setNativeView(TiUIView.java:339) [ERROR] : TiApplication: at hyperloop.HyperloopView.
The PR I've mentioned above is scheduled for 7.0.0 and not merged yet
No change in SDK 7.0.1: [ERROR] : TiApplication: (main) [30100,172427] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object org.appcelerator.kroll.KrollDict.get(java.lang.Object)' on a null object reference; Titanium 7.0.1,2017/12/18 10:42,undefined [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object org.appcelerator.kroll.KrollDict.get(java.lang.Object)' on a null object reference [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiUIView.composeContentDescription(TiUIView.java:2118) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiUIView.applyContentDescription(TiUIView.java:2092) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiUIView.applyAccessibilityProperties(TiUIView.java:2155) [ERROR] : TiApplication: at org.appcelerator.titanium.view.TiUIView.setNativeView(TiUIView.java:345) [ERROR] : TiApplication: at hyperloop.HyperloopView.