Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18516] Android: TiUIWebView.isHTCSenseDevice()

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-06-02T06:48:42.000+0000
Affected Version/sRelease 3.5.0
Fix Version/sRelease 4.1.0
ComponentsAndroid
LabelsisHTCSenseDevice
ReporterShuo Liang
AssigneeAshraf Abu
Created2015-02-05T07:48:21.000+0000
Updated2015-06-30T20:51:38.000+0000

Description

Hi, One of enterprise customer requested a code review for TiUIWebView.isHTCSenseDevice(). As there is error happened in their production app, but really can't reproduce in dev as the problem only happened serval times in specific device which they do no have. So for now, They are suck there and ask for a simple code review for TiUIWebView.isHTCSenseDevice(). Attached error log from newRelic. See if there is something we can do.

Attachments

FileDateSize
isHTCSense_Crash.pdf2015-02-05T07:57:37.000+0000145143

Comments

  1. Muhammad Ahmed Fahad 2015-02-05

    Should be a very simple fix: https://github.com/appcelerator/titanium_mobile/pull/6621/files
  2. Muhammad Ahmed Fahad 2015-03-13

    Hello, Why has this change still not been Closed/Resolved. We had a custom build for 3.5.0, and we didn't see any crashes. After upgrading to 3.5.1, we see this happening again, annoying.
  3. Muhammad Ahmed Fahad 2015-03-13

    The App is crashing on a non-HTC device. Please look into this ASAP
  4. Ingo Muschenetz 2015-03-13

    Do we have a device in-house that reproduces the issue?
  5. Muhammad Ahmed Fahad 2015-03-13

    No. But this is the detail about the device from which we have a crash dump: GI-I9500_TMMARS (GI-I9500_TMMARS) Android 4.1.1 (eng.mars.20141126.142007) 55 MB used RAM 1 GB free disk The PR submitted is a simple one: https://github.com/appcelerator/titanium_mobile/pull/6621/files
  6. Muhammad Ahmed Fahad 2015-04-17

    received another crash from another SAMSUNG Galaxy S4 device
  7. Muhammad Ahmed Fahad 2015-06-01

    @Ingo Muschenetz, why hasn't the PR still been merged, and why is there no fix version? Just received the below crash dump today via Appcelerator Dashboard. The crash seems to happen only on the device model GI-I9500_TMMARS, while the webview is loaded, and the code to load my webview is: var htmlFile = Ti.Filesystem.getFile(Ti.Filesystem.getResourcesDirectory(), 'ui/webview/map.html'); var mapWebView = Ti.UI.createWebView({ top: 35, borderRadius: 1, width: Ti.UI.FILL, height: Ti.UI.FILL, url: htmlFile.nativePath, willHandleTouches: false, loading: true }); if (app.isAndroid) { mapWebView.pluginState = Ti.UI.Android.WEBVIEW_PLUGINS_OFF; mapWebView.cacheMode = Ti.UI.Android.WEBVIEW_LOAD_NO_CACHE; } Stack Trace _________________________________ 0 java.lang.RuntimeException: Unable to start activity ComponentInfo{spacious.home/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException 1 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2060) 2 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2085) 3 at android.app.ActivityThread.access$600(ActivityThread.java:131) 4 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 5 at android.os.Handler.dispatchMessage(Handler.java:99) 6 at android.os.Looper.loop(Looper.java:137) 7 at android.app.ActivityThread.main(ActivityThread.java:4754) 8 at java.lang.reflect.Method.invokeNative(Native Method) 9 at java.lang.reflect.Method.invoke(Method.java:511) 10 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 11 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 12 at dalvik.system.NativeStart.main(Native Method) 13 Caused by: java.lang.NullPointerException 14 at ti.modules.titanium.ui.widget.webview.TiUIWebView.isHTCSenseDevice(TiUIWebView.java:165) 15 at ti.modules.titanium.ui.widget.webview.TiUIWebView.(TiUIWebView.java:184) 16 at ti.modules.titanium.ui.WebViewProxy.createView(WebViewProxy.java:86) 17 at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:483) 18 at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469) 19 at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:507) 20 at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491) 21 at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469) 22 at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:507) 23 at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491) 24 at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469) 25 at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:507) 26 at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491) 27 at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469) 28 at dk.napp.drawer.Drawer.processProperties(Drawer.java:365) 29 at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1209) 30 at dk.napp.drawer.DrawerProxy.windowCreated(DrawerProxy.java:145) 31 at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:33) 32 at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:450) 33 at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:543) 34 at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) 35 at android.app.Activity.performCreate(Activity.java:5008) 36 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081) 37 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2024) 38 ... 11 more 39 java.lang.NullPointerException 40 at ti.modules.titanium.ui.widget.webview.TiUIWebView.isHTCSenseDevice(TiUIWebView.java:165) 41 at ti.modules.titanium.ui.widget.webview.TiUIWebView.(TiUIWebView.java:184) 42 at ti.modules.titanium.ui.WebViewProxy.createView(WebViewProxy.java:86) 43 at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:483) 44 at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469) 45 at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:507) 46 at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491) 47 at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469) 48 at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:507) 49 at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491) 50 at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469) 51 at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:507) 52 at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491) 53 at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469) 54 at dk.napp.drawer.Drawer.processProperties(Drawer.java:365) 55 at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1209) 56 at dk.napp.drawer.DrawerProxy.windowCreated(DrawerProxy.java:145) 57 at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:33) 58 at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:450) 59 at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:543) 60 at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:18) 61 at android.app.Activity.performCreate(Activity.java:5008) 62 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081) 63 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2024) 64 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2085) 65 at android.app.ActivityThread.access$600(ActivityThread.java:131) 66 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 67 at android.os.Handler.dispatchMessage(Handler.java:99) 68 at android.os.Looper.loop(Looper.java:137) 69 at android.app.ActivityThread.main(ActivityThread.java:4754) 70 at java.lang.reflect.Method.invokeNative(Native Method) 71 at java.lang.reflect.Method.invoke(Method.java:511) 72 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 73 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 74 at dalvik.system.NativeStart.main(Native Method) Threads _________________________________ Thread: GAThread 0 java.lang.ClassLoader.findLoadedClass(ClassLoader.java:354) 1 java.lang.BootClassLoader.loadClass(ClassLoader.java:822) 2 java.lang.ClassLoader.loadClass(ClassLoader.java:495) 3 java.lang.ClassLoader.loadClass(ClassLoader.java:461) 4 com.google.android.gms.analytics.c.connect(Unknown Source) 5 com.google.android.gms.analytics.r.ek(Unknown Source) 6 com.google.android.gms.analytics.r.eg(Unknown Source) 7 com.google.android.gms.analytics.s.init(Unknown Source) 8 com.google.android.gms.analytics.s.run(Unknown Source) Thread: RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@4181fef0 0 java.lang.Object.wait(Native Method) 1 java.lang.Object.wait(Object.java:401) 2 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102) 3 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73) 4 org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102) 5 java.lang.Thread.run(Thread.java:856) Thread: TiHttpClient-2 0 ti.modules.titanium.network.TiHTTPClient.getClient(TiHTTPClient.java:1134) 1 ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1252) 2 java.lang.Thread.run(Thread.java:856) Thread: Failed Connect 0 java.lang.Object.wait(Native Method) 1 java.lang.Object.wait(Object.java:401) 2 java.util.Timer$TimerImpl.run(Timer.java:238) Thread: java.lang.ProcessManager 0 java.lang.Object.wait(Native Method) 1 java.lang.Object.wait(Object.java:364) 2 java.lang.ProcessManager.waitForMoreChildren(ProcessManager.java:140) 3 java.lang.ProcessManager.watchChildren(ProcessManager.java:105) 4 java.lang.ProcessManager.access$000(ProcessManager.java:40) 5 java.lang.ProcessManager$1.run(ProcessManager.java:58) Thread: GC 0 dalvik.system.NativeStart.run(Native Method) Thread: pool-1-thread-1 0 java.lang.Object.wait(Native Method) 1 java.lang.Thread.parkFor(Thread.java:1309) 2 sun.misc.Unsafe.park(Unsafe.java:323) 3 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197) 4 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2061) 5 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1066) 6 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:783) 7 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009) 8 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069) 9 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 10 java.lang.Thread.run(Thread.java:856) Thread: OPTMZ 0 dalvik.system.VMStack.getThreadStackTrace(Native Method) 1 java.lang.Thread.getStackTrace(Thread.java:591) 2 java.lang.reflect.Method.invoke(Method.java:515) 3 crittercism.android.ac.a(Unknown Source) 4 crittercism.android.ac.c(Unknown Source) 5 crittercism.android.ac.close(Unknown Source) 6 java.net.Socket.close(Socket.java:316) 7 org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.close(OpenSSLSocketImpl.java:1006) 8 libcore.io.IoUtils.closeQuietly(IoUtils.java:75) 9 libcore.net.http.HttpConnection.closeSocketAndStreams(HttpConnection.java:134) 10 libcore.net.http.HttpEngine.release(HttpEngine.java:512) 11 libcore.net.http.HttpURLConnectionImpl.disconnect(HttpURLConnectionImpl.java:90) 12 libcore.net.http.HttpsURLConnectionImpl.disconnect(HttpsURLConnectionImpl.java:119) 13 crittercism.android.g.a(Unknown Source) 14 crittercism.android.g.run(Unknown Source) 15 crittercism.android.co.a(Unknown Source) 16 crittercism.android.cs.run(Unknown Source) 17 java.lang.Thread.run(Thread.java:856) Thread: Thread-106 0 java.lang.Object.wait(Native Method) 1 java.lang.Thread.parkFor(Thread.java:1309) 2 sun.misc.Unsafe.park(Unsafe.java:323) 3 java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) 4 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022) 5 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413) 6 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009) 7 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069) 8 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 9 crittercism.android.co.a(Unknown Source) 10 crittercism.android.cs.run(Unknown Source) 11 java.lang.Thread.run(Thread.java:856) Thread: JDWP 0 dalvik.system.NativeStart.run(Native Method) Thread: KrollRuntimeThread 0 android.os.MessageQueue.nativePollOnce(Native Method) 1 android.os.MessageQueue.next(MessageQueue.java:125) 2 android.os.Looper.loop(Looper.java:124) 3 org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) Thread: Binder_1 0 dalvik.system.NativeStart.run(Native Method) Thread: FinalizerDaemon 0 java.lang.Object.wait(Native Method) 1 java.lang.Object.wait(Object.java:401) 2 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102) 3 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73) 4 java.lang.Daemons$FinalizerDaemon.run(Daemons.java:169) 5 java.lang.Thread.run(Thread.java:856) Thread: ReferenceQueueDaemon 0 java.lang.Object.wait(Native Method) 1 java.lang.Object.wait(Object.java:364) 2 java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:129) 3 java.lang.Thread.run(Thread.java:856) Thread: TiHttpClient-1 0 java.lang.BootClassLoader.getInstance(ClassLoader.java:752) 1 java.lang.ClassLoader.findLoadedClass(ClassLoader.java:350) 2 java.lang.ClassLoader.loadClass(ClassLoader.java:491) 3 java.lang.ClassLoader.loadClass(ClassLoader.java:461) 4 ti.modules.titanium.network.TiHTTPClient.getClient(TiHTTPClient.java:1134) 5 ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1252) 6 java.lang.Thread.run(Thread.java:856) Thread: Signal Catcher 0 dalvik.system.NativeStart.run(Native Method) Thread: Binder_2 0 dalvik.system.NativeStart.run(Native Method) Thread: FinalizerWatchdogDaemon 0 java.lang.VMThread.sleep(Native Method) 1 java.lang.Thread.sleep(Thread.java:1109) 2 java.lang.Thread.sleep(Thread.java:1053) 3 java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:222) 4 java.lang.Thread.run(Thread.java:856) Thread: RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@41664520 0 java.lang.Object.wait(Native Method) 1 java.lang.Object.wait(Object.java:401) 2 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102) 3 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73) 4 org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102) 5 java.lang.Thread.run(Thread.java:856)
  8. Ashraf Abu 2015-06-02

    Code to use to test (app.js):
       var webview = Titanium.UI.createWebView({url:'http://www.appcelerator.com'});
           var window = Titanium.UI.createWindow();
           window.add(webview);
           window.open({modal:true});
       
  9. Ashraf Abu 2015-06-02

    [~fahad86] PR: https://github.com/appcelerator/titanium_mobile/pull/6621 Code reviewed and tested. Approved and merged. Thank you.
  10. Eric Wieber 2015-06-30

    Verified fixed, using: MacOS 10.11 Studio 4.1.0.201506261427 Ti SDK 4.1.0.v20150626084425 Appc NPM 4.1.0-1 Appc CLI 4.1.0-4 Ti CLI 4.0.1 Alloy 1.6.2 Node v0.10.37 Java 1.7.0_45 Do not witness any errors using TiUIWebView with above code/similar devices.

JSON Source