Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
iamdurui opened this issue Oct 26, 2017 · 13 comments
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@iamdurui
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

No

Environment

react-native: 0.46.2
react: 16.0.0-alpha.12
I got this crash report from Fabric.io but I dont know where and when it happened.

Fatal Exception: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6398)
at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:905)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:4340)
at android.view.View.invalidate(View.java:10968)
at android.view.View.invalidate(View.java:10923)
at android.widget.TextView.updateAfterEdit(TextView.java:7558)
at android.widget.Editor.finishBatchEdit(Editor.java:1121)
at android.widget.Editor.endBatchEdit(Editor.java:1103)
at android.widget.TextView.endBatchEdit(TextView.java:5980)
at com.android.internal.widget.EditableInputConnection.endBatchEdit(EditableInputConnection.java:77)
at android.view.inputmethod.BaseInputConnection.finishComposingText(BaseInputConnection.java:283)
at android.view.inputmethod.InputMethodManager.checkFocusNoStartInput(InputMethodManager.java:1330)
at android.view.inputmethod.InputMethodManager.onWindowFocus(InputMethodManager.java:1374)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3253)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(Unknown Source)
at java.lang.Thread.run(Thread.java:841)

@edo1493
Copy link
Contributor

edo1493 commented Oct 30, 2017

I have just seen this while reloading my android app.

@iamdurui
Copy link
Author

iamdurui commented Nov 2, 2017

@edo1493 Do you know how to solve it? has your android APP is crash yet?

@3210jr
Copy link

3210jr commented Nov 12, 2017

Hey, same issue here.
I am having this issue being reported a lot on my crash reports... I am not sure if its relevant but after trying on a few devices i am notice it becoming very common among the lower end devices like android 4.4.2.

@mihir0x69
Copy link

Can confirm!

@woshiwozwh
Copy link

how to solve this issue?

@3210jr
Copy link

3210jr commented Jan 4, 2018

In my case, the problem was with the perf monitor.

If the perf monitor was running as the app reloaded, then I would get the error.

My work around it simply turn off the perf monitor before the app reloads and then turn it on again.

Hope it helps.

@woshiwozwh
Copy link

I find this bug appears in the released version,the wrong information provided by firebase doesn't help me solve this problem

@hramos hramos added the Android label Mar 8, 2018
@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Mar 18, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@stale
Copy link

stale bot commented Jun 17, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 17, 2018
@nomar22
Copy link

nomar22 commented Jun 25, 2018

@3210jr Thanks for this, my problem was with the perf monitor too.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 25, 2018
@suuzee
Copy link

suuzee commented Aug 30, 2018

I also saw the same issue on my crash reports, and it appears in the released version. But I didn't reproduce this issue. I should refer to the solution of @3210jr . May be a crash report issue causing the released version to collect debug errors...

@suzhou2023
Copy link

Same issue, there are more than a hundred crash reports on my released version.


android.view.CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6593)
at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:966)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:5082)
at android.view.View.invalidateInternal(View.java:12730)
at android.view.View.invalidate(View.java:12694)
at android.view.View.invalidate(View.java:12678)
at android.widget.TextView.updateAfterEdit(TextView.java:8023)
at android.widget.Editor.finishBatchEdit(Editor.java:1277)
at android.widget.Editor.endBatchEdit(Editor.java:1259)
at android.widget.TextView.endBatchEdit(TextView.java:6452)
at com.android.internal.widget.EditableInputConnection.endBatchEdit(EditableInputConnection.java:78)
at android.view.inputmethod.BaseInputConnection.finishComposingText(BaseInputConnection.java:275)
at android.view.inputmethod.InputMethodManager.reportFinishInputConnection(InputMethodManager.java:858)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3471)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:818)

@stale
Copy link

stale bot commented Dec 5, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 5, 2018
@stale
Copy link

stale bot commented Dec 12, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Dec 12, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Dec 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests