android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.

JIRA | lvyunxiao | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Impacted Cases ========================================================================= Cordova Usecase/Navigator App Test/Go Test Page Reproduce Test Steps ========================================================================= 1. Download "usecase-cordova-android-tests-12.41.296.4-1.cordova4.0.zip" (please refer to the url in comment) 2. Unzip the usecase-cordova-android-tests-12.41.296.4-1.cordova4.0.zip, and then install "usecase-cordova-android-tests.apk" unzip usecase-cordova-android-tests-12.41.296.4-1.cordova4.0.zip -d localpath adb install localpath/opt/usecase-cordova-android-tests/usecase-cordova-android-tests.apk 3. Tap the icon of the "usecase-cordova-android-tests" app to open it 4. Select "Navigator App Test" 5. Tap "Go Test Page" button, check the behavior Expected Outcome ========================================================================= Able to go to test page Actual Outcome ========================================================================= No response when tapping "Go Test Page" button Test Case Source Code ===================== || Type || URL || | Source Code | https://github.com/crosswalk-project/crosswalk-test-suite/blob/master/usecase/usecase-cordova-android-tests/samples/NavigatorApp/index.html | | Source Code | https://github.com/crosswalk-project/crosswalk-test-suite/blob/master/usecase/usecase-cordova-android-tests/samples/NavigatorApp/js/main.js | Test Builds ========================================================================= ||Version||Test Date|| Test Device || Cordova Version || Result || |Beta 12.41.296.4 | 2015.03.06| Nexus 5 ARM| 3.6.3 |{color: green}Pass{color}| |Beta 12.41.296.4 | 2015.03.06| Nexus 5 ARM| 4.0.0 |{color: red}Fail{color}| |Canary 14.43.338.0 | 2015.04.24| Nexus 5 ARM| 4.0.0 |{color: red}Fail{color}| |Canary 15.43.344.0 | 2015.05.08| Nexus 5 ARM| 4.0.0 |{color: red}Fail{color}| Log Info ========================================================================= {code} 03-06 11:19:55.205: D/App(12300): App.loadUrl(file:///android_asset/www/samples/NavigatorApp/local.html?test_name=Navigator%20App%20Test,{"loadUrlTimeoutValue":6000,"loadingDialog":"Loading App","wait":0}) 03-06 11:19:55.205: D/CordovaWebViewImpl(12300): showWebPage(file:///android_asset/www/samples/NavigatorApp/local.html?test_name=Navigator%20App%20Test, false, false, HashMap) 03-06 11:19:55.205: D/CordovaWebViewImpl(12300): >>> loadUrl(file:///android_asset/www/samples/NavigatorApp/local.html?test_name=Navigator%20App%20Test) 03-06 11:19:55.205: D/PluginManager(12300): init() 03-06 11:19:55.205: E/PluginManager(12300): Uncaught exception from plugin 03-06 11:19:55.205: E/PluginManager(12300): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6024) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewRootImpl.clearChildFocus(ViewRootImpl.java:2785) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.View.clearFocusInternal(View.java:4725) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.View.clearFocus(View.java:4708) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearFocus(ViewGroup.java:803) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearFocus(ViewGroup.java:807) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearFocus(ViewGroup.java:807) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearFocus(ViewGroup.java:807) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.View.setFlags(View.java:8939) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.View.setVisibility(View.java:6036) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.splashscreen.SplashScreen.pluginInitialize(SplashScreen.java:64) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.java:49) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:161) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:87) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.PluginManager.init(PluginManager.java:76) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaWebViewImpl.loadUrlIntoView(CordovaWebViewImpl.java:138) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaWebViewImpl.showWebPage(CordovaWebViewImpl.java:216) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CoreAndroid.loadUrl(CoreAndroid.java:199) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CoreAndroid.execute(CoreAndroid.java:94) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:82) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.PluginManager.exec(PluginManager.java:122) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59) 03-06 11:19:55.205: E/PluginManager(12300): at org.crosswalk.engine.XWalkExposedJsApi.exec(XWalkExposedJsApi.java:40) 03-06 11:19:55.205: E/PluginManager(12300): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) 03-06 11:19:55.205: E/PluginManager(12300): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53) 03-06 11:19:55.205: E/PluginManager(12300): at android.os.Handler.dispatchMessage(Handler.java:102) 03-06 11:19:55.205: E/PluginManager(12300): at android.os.Looper.loop(Looper.java:136) 03-06 11:19:55.205: E/PluginManager(12300): at android.os.HandlerThread.run(HandlerThread.java:61) {code}

    JIRA | 2 years ago | lvyunxiao
    android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
  2. 0

    Impacted Cases ========================================================================= Cordova Usecase/Navigator App Test/Go Test Page Reproduce Test Steps ========================================================================= 1. Download "usecase-cordova-android-tests-12.41.296.4-1.cordova4.0.zip" (please refer to the url in comment) 2. Unzip the usecase-cordova-android-tests-12.41.296.4-1.cordova4.0.zip, and then install "usecase-cordova-android-tests.apk" unzip usecase-cordova-android-tests-12.41.296.4-1.cordova4.0.zip -d localpath adb install localpath/opt/usecase-cordova-android-tests/usecase-cordova-android-tests.apk 3. Tap the icon of the "usecase-cordova-android-tests" app to open it 4. Select "Navigator App Test" 5. Tap "Go Test Page" button, check the behavior Expected Outcome ========================================================================= Able to go to test page Actual Outcome ========================================================================= No response when tapping "Go Test Page" button Test Case Source Code ===================== || Type || URL || | Source Code | https://github.com/crosswalk-project/crosswalk-test-suite/blob/master/usecase/usecase-cordova-android-tests/samples/NavigatorApp/index.html | | Source Code | https://github.com/crosswalk-project/crosswalk-test-suite/blob/master/usecase/usecase-cordova-android-tests/samples/NavigatorApp/js/main.js | Test Builds ========================================================================= ||Version||Test Date|| Test Device || Cordova Version || Result || |Beta 12.41.296.4 | 2015.03.06| Nexus 5 ARM| 3.6.3 |{color: green}Pass{color}| |Beta 12.41.296.4 | 2015.03.06| Nexus 5 ARM| 4.0.0 |{color: red}Fail{color}| |Canary 14.43.338.0 | 2015.04.24| Nexus 5 ARM| 4.0.0 |{color: red}Fail{color}| |Canary 15.43.344.0 | 2015.05.08| Nexus 5 ARM| 4.0.0 |{color: red}Fail{color}| Log Info ========================================================================= {code} 03-06 11:19:55.205: D/App(12300): App.loadUrl(file:///android_asset/www/samples/NavigatorApp/local.html?test_name=Navigator%20App%20Test,{"loadUrlTimeoutValue":6000,"loadingDialog":"Loading App","wait":0}) 03-06 11:19:55.205: D/CordovaWebViewImpl(12300): showWebPage(file:///android_asset/www/samples/NavigatorApp/local.html?test_name=Navigator%20App%20Test, false, false, HashMap) 03-06 11:19:55.205: D/CordovaWebViewImpl(12300): >>> loadUrl(file:///android_asset/www/samples/NavigatorApp/local.html?test_name=Navigator%20App%20Test) 03-06 11:19:55.205: D/PluginManager(12300): init() 03-06 11:19:55.205: E/PluginManager(12300): Uncaught exception from plugin 03-06 11:19:55.205: E/PluginManager(12300): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6024) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewRootImpl.clearChildFocus(ViewRootImpl.java:2785) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearChildFocus(ViewGroup.java:790) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.View.clearFocusInternal(View.java:4725) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.View.clearFocus(View.java:4708) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearFocus(ViewGroup.java:803) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearFocus(ViewGroup.java:807) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearFocus(ViewGroup.java:807) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.ViewGroup.clearFocus(ViewGroup.java:807) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.View.setFlags(View.java:8939) 03-06 11:19:55.205: E/PluginManager(12300): at android.view.View.setVisibility(View.java:6036) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.splashscreen.SplashScreen.pluginInitialize(SplashScreen.java:64) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.java:49) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:161) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:87) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.PluginManager.init(PluginManager.java:76) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaWebViewImpl.loadUrlIntoView(CordovaWebViewImpl.java:138) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaWebViewImpl.showWebPage(CordovaWebViewImpl.java:216) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CoreAndroid.loadUrl(CoreAndroid.java:199) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CoreAndroid.execute(CoreAndroid.java:94) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:82) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.PluginManager.exec(PluginManager.java:122) 03-06 11:19:55.205: E/PluginManager(12300): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59) 03-06 11:19:55.205: E/PluginManager(12300): at org.crosswalk.engine.XWalkExposedJsApi.exec(XWalkExposedJsApi.java:40) 03-06 11:19:55.205: E/PluginManager(12300): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) 03-06 11:19:55.205: E/PluginManager(12300): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53) 03-06 11:19:55.205: E/PluginManager(12300): at android.os.Handler.dispatchMessage(Handler.java:102) 03-06 11:19:55.205: E/PluginManager(12300): at android.os.Looper.loop(Looper.java:136) 03-06 11:19:55.205: E/PluginManager(12300): at android.os.HandlerThread.run(HandlerThread.java:61) {code}

    JIRA | 2 years ago | lvyunxiao
    android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
  3. 0

    Android : FATAL EXCEPTION AsyncTask #4

    Stack Overflow | 4 years ago | floflo41
    java.lang.RuntimeException: An error occured while executing doInBackground()
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SIP manual registration + Textview update

    Stack Overflow | 4 years ago | onizukaek
    android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
  6. 0

    Android - admob banner crashes when setting back to visible

    Stack Overflow | 2 years ago | Ben James
    android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. android.view.ViewRootImpl$CalledFromWrongThreadException

    Only the original thread that created a view hierarchy can touch its views.

    at android.view.ViewRootImpl.checkThread()
  2. Android Platform
    View.setVisibility
    1. android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6024)
    2. android.view.ViewRootImpl.clearChildFocus(ViewRootImpl.java:2785)
    3. android.view.ViewGroup.clearChildFocus(ViewGroup.java:790)
    4. android.view.ViewGroup.clearChildFocus(ViewGroup.java:790)
    5. android.view.ViewGroup.clearChildFocus(ViewGroup.java:790)
    6. android.view.ViewGroup.clearChildFocus(ViewGroup.java:790)
    7. android.view.ViewGroup.clearChildFocus(ViewGroup.java:790)
    8. android.view.ViewGroup.clearChildFocus(ViewGroup.java:790)
    9. android.view.View.clearFocusInternal(View.java:4725)
    10. android.view.View.clearFocus(View.java:4708)
    11. android.view.ViewGroup.clearFocus(ViewGroup.java:803)
    12. android.view.ViewGroup.clearFocus(ViewGroup.java:807)
    13. android.view.ViewGroup.clearFocus(ViewGroup.java:807)
    14. android.view.ViewGroup.clearFocus(ViewGroup.java:807)
    15. android.view.View.setFlags(View.java:8939)
    16. android.view.View.setVisibility(View.java:6036)
    16 frames
  3. org.apache.cordova
    CordovaBridge.jsExec
    1. org.apache.cordova.splashscreen.SplashScreen.pluginInitialize(SplashScreen.java:64)
    2. org.apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.java:49)
    3. org.apache.cordova.PluginManager.getPlugin(PluginManager.java:161)
    4. org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:87)
    5. org.apache.cordova.PluginManager.init(PluginManager.java:76)
    6. org.apache.cordova.CordovaWebViewImpl.loadUrlIntoView(CordovaWebViewImpl.java:138)
    7. org.apache.cordova.CordovaWebViewImpl.showWebPage(CordovaWebViewImpl.java:216)
    8. org.apache.cordova.CoreAndroid.loadUrl(CoreAndroid.java:199)
    9. org.apache.cordova.CoreAndroid.execute(CoreAndroid.java:94)
    10. org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:82)
    11. org.apache.cordova.PluginManager.exec(PluginManager.java:122)
    12. org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
    12 frames
  4. org.crosswalk.engine
    XWalkExposedJsApi.exec
    1. org.crosswalk.engine.XWalkExposedJsApi.exec(XWalkExposedJsApi.java:40)
    1 frame
  5. org.chromium.base
    SystemMessageHandler.handleMessage
    1. org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
    2. org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53)
    2 frames
  6. Android Platform
    HandlerThread.run
    1. android.os.Handler.dispatchMessage(Handler.java:102)
    2. android.os.Looper.loop(Looper.java:136)
    3. android.os.HandlerThread.run(HandlerThread.java:61)
    3 frames