-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Android.Util.AndroidRuntimeException: Only the original thread that created a view hierarchy can touch its views. #14128
Comments
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
Reproduced and definitely seems to be similar to the issue I've been working on fixing. Will test with my fix momentarily. |
This is a duplicate of issue #14052 |
First I need to figure out how to write a unit test and then I have to get my patch reviewed/accepted/merged and then a release has to be made (which I believe is done on a fixed schedule and I'm not sure what that schedule is - I'm new to the team and am temporarily helping them out). |
Ok thanks Jeffrey. I appriciate you are working the issue. Looking forward to hearing from you again.
Med venlig hilsen / Best regards
Søren Bech
…________________________________
From: Jeffrey Stedfast ***@***.***>
Sent: Tuesday, March 28, 2023 3:33:10 PM
To: dotnet/maui ***@***.***>
Cc: SorenBech2 ***@***.***>; Author ***@***.***>
Subject: Re: [dotnet/maui] Android.Util.AndroidRuntimeException: Only the original thread that created a view hierarchy can touch its views. (Issue #14128)
First I need to figure out how to write a unit test and then I have to get my patch reviewed/accepted/merged and then a release has to be made (which I believe is done on a fixed schedule and I'm not sure what that schedule is - I'm new to the team and am temporarily helping them out).
—
Reply to this email directly, view it on GitHub<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fmaui%2Fissues%2F14128%23issuecomment-1486898074&data=05%7C01%7C%7C0b9f22b1d796460a373608db2f90f947%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638156071919971244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=9FFKKmwweNktxsGKH6%2F2Kq8Qi9ieVva5HljuLM%2FfAbE%3D&reserved=0>, or unsubscribe<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA2Y4YKSN6WRM5WSKQMIUZG3W6LSBNANCNFSM6AAAAAAWD2IUMQ&data=05%7C01%7C%7C0b9f22b1d796460a373608db2f90f947%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638156071919971244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XJduaiN2ej2JIzNALqe4w7CiegL1b20tNjlfSHljEcU%3D&reserved=0>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hi @SorenBech2. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version. You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 1.0. Not repro on android platform with sample project. |
Thank for your reply to this issue. The issue has not been resolved using the latest version of Visual Studio
Microsoft Visual Studio Community 2022 (64-bit) – Current Version 17.6.5
Selecting an image minimum TWICE in the attached test app
(SorenBech2/DataBindingTest (github.com)<https://github.com/SorenBech2/DataBindingTest> (same app/code as initially attached)
yields the below message.
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:11586)
at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:2648)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at androidx.drawerlayout.widget.DrawerLayout.requestLayout(DrawerLayout.java:1353)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at androidx.recyclerview.widget.RecyclerView.requestLayout(RecyclerView.java:4586)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at androidx.core.widget.NestedScrollView.requestLayout(NestedScrollView.java:2075)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.view.View.requestLayout(View.java:27612)
at android.widget.ImageView.setImageDrawable(ImageView.java:602)
at androidx.appcompat.widget.AppCompatImageView.setImageDrawable(AppCompatImageView.java:112)
at com.microsoft.maui.glide.MauiCustomViewTarget.onResourceCleared(MauiCustomViewTarget.java:30)
at com.bumptech.glide.request.target.CustomViewTarget.onLoadCleared(CustomViewTarget.java:210)
at com.bumptech.glide.request.SingleRequest.clear(SingleRequest.java:337)
at com.bumptech.glide.request.ErrorRequestCoordinator.clear(ErrorRequestCoordinator.java:48)
at com.bumptech.glide.manager.RequestTracker.clearAndRemove(RequestTracker.java:70)
at com.bumptech.glide.RequestManager.untrack(RequestManager.java:660)
at com.bumptech.glide.RequestManager.untrackOrDelegate(RequestManager.java:628)
at com.bumptech.glide.RequestManager.clear(RequestManager.java:624)
at com.bumptech.glide.RequestBuilder.into(RequestBuilder.java:811)
at com.bumptech.glide.RequestBuilder.into(RequestBuilder.java:780)
at com.bumptech.glide.RequestBuilder.into(RequestBuilder.java:771)
at com.microsoft.maui.PlatformInterop.prepare(PlatformInterop.java:229)
at com.microsoft.maui.PlatformInterop.loadInto(PlatformInterop.java:234)
at com.microsoft.maui.PlatformInterop.loadImageFromStream(PlatformInterop.java:265)
Med venlig hilsen / Best regards
Søren Bech
Sigridsvej 17B
DK-2900 Hellerup
+45 4076 5050
***@***.***
From: msftbot[bot] ***@***.***>
Sent: Monday, 19 June 2023 05.28
To: dotnet/maui ***@***.***>
Cc: SorenBech2 ***@***.***>; Mention ***@***.***>
Subject: Re: [dotnet/maui] Android.Util.AndroidRuntimeException: Only the original thread that created a view hierarchy can touch its views. (Issue #14128)
Hi @SorenBech2<https://github.com/SorenBech2>. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project<https://github.com/dotnet/maui/blob/main/.github/repro.md> provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
—
Reply to this email directly, view it on GitHub<#14128 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A2Y4YKXFRP5BFHI2E63YBVLXL7BMPANCNFSM6AAAAAAWD2IUMQ>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Description
An app that based on a selection made through a picker list, displays the object information - including the object image – of the selected object.
Picking an item for the 2nd time the image does not show and the below error message is generated. (The error does not occur when code is compiled to windows which leads to a suspicion of a bug in the Android generated code.)
For full description please see below.
Maui Databinding issue.docx
Steps to Reproduce
Debug the code in the repository (link below).
Picking an item for the 2nd time the image does not show and the below error message is generated.
OBS: To reproduce you need to pick a subject and then pick a different subject from the picker list.
When a 3rd subject is selected everything works fine (as well as for the 4th, 5th, and so on) The error only occur for the 2nd selection! (In a few tests, this error occurs after 3 selections not 2, but predominantly after 2 selections).
It is unclear to me which code executed in another thread but the UI thread creates the error. I have included a check on the thread which indicated the code is executed in the UI thread - as well as tried to include the code in a MainThread.BeginInvokeOnMainThread without any impact on the error.
Link to public reproduction project repository
https://github.com/SorenBech2/DataBindingTest
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12.1 - API 32 & 13.0 API 33
Did you find any workaround?
No workaround found. Tried to include the code in a MainThread.BeginInvokeOnMainThread without any impact on the error.
Relevant log output
The text was updated successfully, but these errors were encountered: