Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26205] Android: getActionBar() throws "CalledFromWrongThreadException" exception

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-07-20T19:10:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
Componentsn/a
Labelsactionbar, android, bug
ReporterSergey Volkov
AssigneeGary Mathews
Created2018-07-11T12:29:27.000+0000
Updated2018-09-26T14:37:13.000+0000

Description

[WARN]  W/System.err: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
[WARN]  W/System.err:   at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6816)
[WARN]  W/System.err:   at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:975)
[WARN]  W/System.err:   at android.view.ViewGroup.invalidateChild(ViewGroup.java:5125)
[WARN]  W/System.err:   at android.view.View.invalidateInternal(View.java:12774)
[WARN]  W/System.err:   at android.view.View.invalidate(View.java:12738)
[WARN]  W/System.err:   at android.view.View.invalidate(View.java:12722)
[WARN]  W/System.err:   at android.widget.ImageView.invalidateDrawable(ImageView.java:246)
[WARN]  W/System.err:   at android.graphics.drawable.Drawable.invalidateSelf(Drawable.java:385)
[WARN]  W/System.err:   at android.graphics.drawable.Drawable.setVisible(Drawable.java:764)
[WARN]  W/System.err:   at android.widget.ImageView.onDetachedFromWindow(ImageView.java:1515)
[WARN]  W/System.err:   at android.view.View.dispatchDetachedFromWindow(View.java:14616)
[WARN]  W/System.err:   at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4647)
[WARN]  W/System.err:   at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4620)
[WARN]  W/System.err:   at android.view.ViewGroup.removeView(ViewGroup.java:4551)
[WARN]  W/System.err:   at android.support.v7.widget.Toolbar.setNavigationIcon(Toolbar.java:962)
[WARN]  W/System.err:   at android.support.v7.widget.ToolbarWidgetWrapper.updateNavigationIcon(ToolbarWidgetWrapper.java:613)
[WARN]  W/System.err:   at android.support.v7.widget.ToolbarWidgetWrapper.setDisplayOptions(ToolbarWidgetWrapper.java:392)
[WARN]  W/System.err:   at android.support.v7.app.ToolbarActionBar.setDisplayOptions(ToolbarActionBar.java:260)
[WARN]  W/System.err:   at android.support.v7.app.ToolbarActionBar.setDisplayOptions(ToolbarActionBar.java:254)
[WARN]  W/System.err:   at org.appcelerator.titanium.proxy.ActionBarProxy.<init>(ActionBarProxy.java:58)
[WARN]  W/System.err:   at org.appcelerator.titanium.proxy.ActivityProxy.getActionBar(ActivityProxy.java:258)
[WARN]  W/System.err:   at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)
[WARN]  W/System.err:   at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:57)
[WARN]  W/System.err:   at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:43)
[WARN]  W/System.err:   at ti.modules.titanium.TitaniumModule$Timer.run(TitaniumModule.java:147)
[WARN]  W/System.err:   at android.os.Handler.handleCallback(Handler.java:739)
[WARN]  W/System.err:   at android.os.Handler.dispatchMessage(Handler.java:95)
[WARN]  W/System.err:   at android.os.Looper.loop(Looper.java:148)
[WARN]  W/System.err:   at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118)
Patch with fix is in attachment.

Attachments

FileDateSize
0001-fix-ActionBar-CalledFromWrongThreadException.patch2018-07-11T12:25:43.000+00003097

Comments

  1. Sharif AbuDarda 2018-07-12

    Hello [~s.volkov], Thanks for the ticket. Our engineering will look into it.
  2. Sergey Volkov 2018-07-12

    https://github.com/appcelerator/titanium_mobile/pull/10176
  3. Samir Mohammed 2018-09-26

    *Closing ticket.* Verified fix in SDK version 7.5.0.v20180925002114. getActionBar() no longer throws "CalledFromWrongThreadException" exception. *Test Environment*
       APPC Studio: 5.1.0.201808080937
       Nexus 5X (API 23)
       APPC CLI: 7.0.7-master.1
       Operating System Name: Mac OS Mojave
       Operating System Version: 10.14
       Node.js Version: 8.9.1
       Xcode 10.0
       

JSON Source