Status Update
Comments
jl...@google.com <jl...@google.com> #2
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
rk...@google.com <rk...@google.com> #3
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
ok...@gmail.com <ok...@gmail.com> #4
But I think it is better when set before this line
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
Set android:layoutDirection="locale" or android:layoutDirection="inherit" for AppCompatTextView in the XML layout didn't this problem.
The new method btw re-set layoutDirector. Weird! This should handle in the AppcompatTextView.
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
textView.layoutDirection = textView.layoutDirection
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
rk...@google.com <rk...@google.com> #5
minSdk 21
targetSdk 28
Thanks #3 again.
ok...@gmail.com <ok...@gmail.com> #6
TextViewCompat.java:889
if (!param.equals(precomputed.getParams())) {
throw new IllegalArgumentException("Given text can not be applied to TextView.");
}
PrecomputedTextCompat.class:334
with : this.mTextDir != other.getTextDirection() == true
So,
TextDirection on TextView and TextDirection on Param is difference
maybe, it handled wrong or missing conditional on getTextDirectionHeuristic of TextViewCompat
ch...@gmail.com <ch...@gmail.com> #7
ja...@gmail.com <ja...@gmail.com> #8
But I think you should handle it in the AppcompatTextView. It is better. If a developer forgets testing with RTL. I think this is the nightmare(it is difficult to determine the bug) when they update their app on the Play Store.
I read this article, in the part databing he noted about set the direction
fun asyncText
..........
// first, set all measurement affecting properties of the text
// (size, locale, typeface, direction, etc)
But in the offical document isn't good (lack direction)
Anything layout related property changes, text size, typeface, letter spacing, etc after this method call will causes IllegalArgumentException during View measurement.
My view: Handling this in the AppcompatTextView is the best choice if you can do it.
Thanks!
ch...@gmail.com <ch...@gmail.com> #9
ig...@gmail.com <ig...@gmail.com> #10
rk...@google.com <rk...@google.com> #11
ja...@gmail.com <ja...@gmail.com> #12
Description shared by an external reporter:
================================
1.
Version used: androidx.appcompat:appcompat:1.1.0-alpha1
AppCompatTextView.setTextFuture
i found
2.
Non-fatal Exception: java.lang.IllegalArgumentException: Given text can not be applied to TextView.
at androidx.core.widget.TextViewCompat.retrieveField(Unknown Source:22)
at androidx.appcompat.widget.AppCompatTextView.consumeTextFutureAndSetBlocking(Unknown Source:15)
at androidx.appcompat.widget.AppCompatTextView.onMeasure(Unknown Source)
at com.bilibili.magicasakura.widgets.AppCompatTintTextView.onMeasure(Unknown Source)
at android.view.View.measure(View.java:22145)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
at android.view.View.measure(View.java:22145)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at androidx.cardview.widget.CardView.onMeasure(Unknown Source:80)
at android.view.View.measure(View.java:22145)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.measureChildWithMargins(Unknown Source:98)
at androidx.recyclerview.widget.LinearLayoutManager.generateDefaultLayoutParams(Unknown Source:60)
at androidx.recyclerview.widget.LinearLayoutManager.generateDefaultLayoutParams(Unknown Source:44)
at androidx.recyclerview.widget.LinearLayoutManager.findViewByPosition(Unknown Source:36)
at androidx.recyclerview.widget.LinearLayoutManager.setOrientation(Unknown Source:6)
at androidx.recyclerview.widget.RecyclerView.exceptionLabel(Unknown Source:39)
at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(Unknown Source:91)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:979)
at android.view.Choreographer.doCallbacks(Choreographer.java:791)
at android.view.Choreographer.doFrame(Choreographer.java:723)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:965)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6707)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:108)
device: meizu, Android 7 and 8
And you can see fabric detail
===========================================
Requesting team for initial inputs. Please let us know if this can be handled as a part of this bug else we will create a separate bug for this.
ok...@gmail.com <ok...@gmail.com> #13
ch...@gmail.com <ch...@gmail.com> #14
ja...@google.com <ja...@google.com> #15
Looks like our gRPC endpoint is not responding to new screenshot events from the renderer, causing studio not to update it's ui. It doesn't appear to be happening on TOT (in canary).
ja...@google.com <ja...@google.com> #16
To be clear there are 2 possible causes we can investigate further:
- The emulator is producing frames, but Android Studio is not picking them up and displaying them.
- The emulator gRPC engine is not receiving frame events from the graphics engine, and therefor not producing frames.
Given that users report that the issue arose with a new emulator version, independently of studio, we should start with #2.
ja...@google.com <ja...@google.com> #17
Ok, might have a local repro:
<--snip-->
13:40:09.646634 140674645149376 DEBUG MultiDisplay.cpp:239 | getMultiDisplay 0 x 0 y 0 w 1080 h 2220 dpi 0 flag 0 enable 1
13:40:09.653825 140674645149376 DEBUG MultiDisplay.cpp:239 | getMultiDisplay 0 x 0 y 0 w 1080 h 2220 dpi 0 flag 0 enable 1
13:40:09.653869 140674645149376 DEBUG EmulatorService.cpp:1034 | Screenshot 612x1258 (xAxis: -4.7500019073486328), pixels: 2309688 in 7197 us.
13:40:09.653900 140674636756672 DEBUG MultiDisplay.cpp:239 | getMultiDisplay 0 x 0 y 0 w 1080 h 2220 dpi 0 flag 0 enable 1
13:40:09.653979 140674636756672 DEBUG EmulatorService.cpp:1009 | Allocation of string object. 0 < 2302248
13:40:09.654023 140675121952448 DEBUG MultiDisplay.cpp:239 | getMultiDisplay 0 x 0 y 0 w 1080 h 2220 dpi 0 flag 0 enable 1
13:40:09.670349 140674636756672 DEBUG MultiDisplay.cpp:239 | getMultiDisplay 0 x 0 y 0 w 1080 h 2220 dpi 0 flag 0 enable 1
13:40:09.670385 140674636756672 DEBUG EmulatorService.cpp:1034 | Screenshot 611x1256 (xAxis: -4.7500019073486328), pixels: 2302248 in 12423 us.
13:40:09.670465 140675121952448 DEBUG MultiDisplay.cpp:239 | getMultiDisplay 0 x 0 y 0 w 1080 h 2220 dpi 0 flag 0 enable 1
13:41:37.682536 140674628363968 DEBUG MultiDisplay.cpp:239 | getMultiDisplay 0 x 0 y 0 w 1080 h 2220 dpi 0 flag 0 enable 1 (4585x)
13:41:37.682596 140674628363968 DEBUG LoggingInterceptor.cpp:84 | from: , start: 1701898897682243, rcvTime: 75, sndTime: 150, rcv: 24, snd: 24, rcv_cnt: 1, snd_cnt: 1, OK , /android.emulation.control.EmulatorController/getVmState() -> [state: RUNNING]
13:41:37.685011 140675121952448 DEBUG MultiDisplay.cpp:239 | getMultiDisplay 0 x 0 y 0 w 1080 h 2220 dpi 0 flag 0 enable 1
No new frames are being produced.. Let's see if we can attach a debugger.
ja...@google.com <ja...@google.com> #18
Surprise #1: Multiple threads are waiting to register itself with the graphics engine..
thread #130, name = 'grpcpp_sync_ser'
android::base::ConditionVariable::wait(this=0x000055b207cae5d0, userLock=0x000055b207cae578) at ConditionVariable.h:146:9
frame #5: 0x00007ff253c0157b libandroid-emu-metrics.so`android::base::MessageChannelBase::beforeWrite(this=0x000055b207cae558) at MessageChannel.cpp:52:19
frame #6: 0x000055b206d2e683 qemu-system-x86_64`android::base::CallbackRegistry::registerCallback(void (*)(void*), void*) [inlined] android::base::MessageChannel<android::base::CallbackRegistry::ForwarderMessage, 64ul>::send(this=<unavailable>, msg=<unavailable>) at MessageChannel.h:122:28
frame #7: 0x000055b206d2e67e qemu-system-x86_64`android::base::CallbackRegistry::registerCallback(this=<unavailable>, messageAvailable=<unavailable>, opaque=<unavailable>) at CallbackRegistry.cpp:53:15
frame #8: 0x000055b206e9734b qemu-system-x86_64`android::emulation::control::EmulatorControllerImpl::streamScreenshot(grpc::ServerContext*, android::emulation::control::ImageFormat const*, grpc::ServerWriter<android::emulation::control::Image>*) [inlined] std::__1::__unique_if<android::emulation::control::EventWaiter>::__unique_single std::__1::make_unique[abi:v170000]<android::emulation::control::EventWaiter, void (*)(void (*)(void*), void*), void (*)(void*)>(__args=<unavailable>, __args=<unavailable>) at unique_ptr.h:686:30
frame #9: 0x000055b206e97326 qemu-system-x86_64`android::emulation::control::EmulatorControllerImpl::streamScreenshot(this=0x000055b20d9e2000, context=0x000055b236aeec10, request=0x000055b239a84870, writer=0x00007ff166c1bd88) at EmulatorService.cpp:717:23
thread #131, name = 'grpcpp_sync_ser'
frame #0: 0x00007ff251ca3156 libc.so.6`__futex_abstimed_wait_common at futex-internal.c:57:12
frame #1: 0x00007ff251ca3118 libc.so.6`__futex_abstimed_wait_common(futex_word=0x000055b207cae5f8, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:87:9
frame #2: 0x00007ff251ca5818 libc.so.6`___pthread_cond_wait at pthread_cond_wait.c:503:10
frame #3: 0x00007ff251ca5740 libc.so.6`___pthread_cond_wait(cond=0x000055b207cae5d0, mutex=0x000055b207cae578) at pthread_cond_wait.c:618:10
frame #4: 0x00007ff253c0158b libandroid-emu-metrics.so`android::base::MessageChannelBase::beforeWrite() [inlined] android::base::ConditionVariable::wait(this=0x000055b207cae5d0, userLock=0x000055b207cae578) at ConditionVariable.h:146:9
frame #5: 0x00007ff253c0157b libandroid-emu-metrics.so`android::base::MessageChannelBase::beforeWrite(this=0x000055b207cae558) at MessageChannel.cpp:52:19
frame #6: 0x000055b206d2e683 qemu-system-x86_64`android::base::CallbackRegistry::registerCallback(void (*)(void*), void*) [inlined] android::base::MessageChannel<android::base::CallbackRegistry::ForwarderMessage, 64ul>::send(this=<unavailable>, msg=<unavailable>) at MessageChannel.h:122:28
frame #7: 0x000055b206d2e67e qemu-system-x86_64`android::base::CallbackRegistry::registerCallback(this=<unavailable>, messageAvailable=<unavailable>, opaque=<unavailable>) at CallbackRegistry.cpp:53:15
frame #8: 0x000055b206e9734b qemu-system-x86_64`android::emulation::control::EmulatorControllerImpl::streamScreenshot(grpc::ServerContext*, android::emulation::control::ImageFormat const*, grpc::ServerWriter<android::emulation::control::Image>*) [inlined] std::__1::__unique_if<android::emulation::control::EventWaiter>::__unique_single std::__1::make_unique[abi:v170000]<android::emulation::control::EventWaiter, void (*)(void (*)(void*), void*), void (*)(void*)>(__args=<unavailable>, __args=<unavailable>) at unique_ptr.h:686:30
frame #9: 0x000055b206e97326 qemu-system-x86_64`android::emulation::control::EmulatorControllerImpl::streamScreenshot(this=0x000055b20d9e2000, context=0x000055b236af2e10, request=0x000055b20c672870, writer=0x00007ff16d04fd88) at EmulatorService.cpp:717:23
thread #132, name = 'grpcpp_sync_ser'
frame #0: 0x00007ff251ca3156 libc.so.6`__futex_abstimed_wait_common at futex-internal.c:57:12
frame #1: 0x00007ff251ca3118 libc.so.6`__futex_abstimed_wait_common(futex_word=0x000055b207cae5f8, expected=0, clockid=<unavailable>, abstime=0x0000000000000000, private=<unavailable>, cancel=<unavailable>) at futex-internal.c:87:9
frame #2: 0x00007ff251ca5818 libc.so.6`___pthread_cond_wait at pthread_cond_wait.c:503:10
frame #3: 0x00007ff251ca5740 libc.so.6`___pthread_cond_wait(cond=0x000055b207cae5d0, mutex=0x000055b207cae578) at pthread_cond_wait.c:618:10
frame #4: 0x00007ff253c0158b libandroid-emu-metrics.so`android::base::MessageChannelBase::beforeWrite() [inlined] android::base::ConditionVariable::wait(this=0x000055b207cae5d0, userLock=0x000055b207cae578) at ConditionVariable.h:146:9
frame #5: 0x00007ff253c0157b libandroid-emu-metrics.so`android::base::MessageChannelBase::beforeWrite(this=0x000055b207cae558) at MessageChannel.cpp:52:19
frame #6: 0x000055b206d2e683 qemu-system-x86_64`android::base::CallbackRegistry::registerCallback(void (*)(void*), void*) [inlined] android::base::MessageChannel<android::base::CallbackRegistry::ForwarderMessage, 64ul>::send(this=<unavailable>, msg=<unavailable>) at MessageChannel.h:122:28
frame #7: 0x000055b206d2e67e qemu-system-x86_64`android::base::CallbackRegistry::registerCallback(this=<unavailable>, messageAvailable=<unavailable>, opaque=<unavailable>) at CallbackRegistry.cpp:53:15
frame #8: 0x000055b206e9734b qemu-system-x86_64`android::emulation::control::EmulatorControllerImpl::streamScreenshot(grpc::ServerContext*, android::emulation::control::ImageFormat const*, grpc::ServerWriter<android::emulation::control::Image>*) [inlined] std::__1::__unique_if<android::emulation::control::EventWaiter>::__unique_single std::__1::make_unique[abi:v170000]<android::emulation::control::EventWaiter, void (*)(void (*)(void*), void*), void (*)(void*)>(__args=<unavailable>, __args=<unavailable>) at unique_ptr.h:686:30
frame #9: 0x000055b206e97326 qemu-system-x86_64`android::emulation::control::EmulatorControllerImpl::streamScreenshot(this=0x000055b20d9e2000, context=0x000055b236aec810, request=0x000055b2399e8870, writer=0x00007ff1813fbd88) at EmulatorService.cpp:717:23
ja...@google.com <ja...@google.com> #19
An unintentional side effect of the fix of
This is not the case for physical events. Things get unblocked as soon as a sensor state change happens.
bo...@mfour.com <bo...@mfour.com> #20
Just wanted to add I've been experiencing this as well on an M1 Mac. For me running the app in release mode works fine. If you build and run in Debug and have the debugger attached, then the frames are not updating.
However this only happens in Canary:
Android Studio Iguana | 2023.2.1 Canary 17
Build #AI-232.10227.8.2321.11191411, built on December 7, 2023
Runtime version: 17.0.9+0-17.0.9b1087.7-11185874 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.2
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 10
Metal Rendering is ON
Registry:
debugger.new.tool.window.layout=true
ide.instant.shutdown=false
ide.experimental.ui=true
If I run the same exact emulator version 34.1.13-11169323
, in current Stable:
Android Studio Hedgehog | 2023.1.1
Build #AI-231.9392.1.2311.11076708, built on November 9, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.2
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 10
Metal Rendering is ON
Registry:
external.system.auto.import.disabled=true
debugger.new.tool.window.layout=true
ide.text.editor.with.preview.show.floating.toolbar=false
ide.instant.shutdown=false
ide.experimental.ui=true
It does not have this issue.
Worth noting that the pop-out mode doesn't affect this.
co...@protonmail.com <co...@protonmail.com> #23
what version of emulator should this be in?
mi...@fresha.com <mi...@fresha.com> #24
la...@gmail.com <la...@gmail.com> #25
Still seeing this issue with 34.1.15-11228956 in AS Hedgehog 2023.1.1 patch 1
co...@protonmail.com <co...@protonmail.com> #26
FWIW Not seeing this issue anymore in latest canaries/beta.
ok...@gmail.com <ok...@gmail.com> #27
Android Studio Hedgehog | 2023.1.1 Patch 2
Build #AI-231.9392.1.2311.11330709, built on January 19, 2024
Emulator version : 34.1.13-11169323
el...@gmail.com <el...@gmail.com> #28
Android Studio Iguana | 2023.2.1 Beta 2
Build #AI-232.10227.8.2321.11280706, built on January 5, 2024
Android emulator version 34.1.15.0 (build_id 11228956) (CL:N/A)
ch...@gmail.com <ch...@gmail.com> #29
ch...@gmail.com <ch...@gmail.com> #30
ad...@gmail.com <ad...@gmail.com> #31
I'm having this issue still.
Android Studio Iguana | 2023.2.1 Build #AI-232.10227.8.2321.11479570, built on February 22, 2024 Runtime version: 17.0.9+0--11185874 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11.0
Android emulator version 34.1.18.0
al...@gmail.com <al...@gmail.com> #32
Android Studio Iguana | 2023.2.1
Build #AI-232.10227.8.2321.11479570, built on February 22, 2024
Runtime version: 17.0.9+0--11185874 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4086M
Cores: 12
Registry:
ide.experimental.ui=true
Non-Bundled Plugins:
Dart (232.10286)
com.bloc.intellij_generator_plugin (3.4.0)
io.flutter (78.0.2)
Emulator version: 34.1.18
CPU: Ryzen 5600
GPU: Radeon 6500XT
xa...@google.com <xa...@google.com> #33
This should be fixed in 34.1.19, please update and let us know.
so...@google.com <so...@google.com> #34
so...@google.com <so...@google.com> #35
Note
From now till end of Feb 2024, we are migrating to using a separate task item to track postmortem status, instead of using the original fixed bug. You may run into unexpected issues as we iron out the wrinkles in the automated workflow. Any questions or feedback, please email: android-hygiene-autobug-filer@.
Thank you for your patience and support.
Description
I'll try to get more details, but wanted to bring it up at least.