Fixed
Status Update
Comments
wi...@google.com <wi...@google.com> #2
Or when changing to textView.textMetricsParamsCompat still crash.
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
ra...@gmail.com <ra...@gmail.com> #3
add this line :
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
ra...@gmail.com <ra...@gmail.com> #4
Thanks, #3. It worked.
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
}
}
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
}
}
wi...@google.com <wi...@google.com> #5
Sorry. I forgot the info.
minSdk 21
targetSdk 28
Thanks #3 again.
minSdk 21
targetSdk 28
Thanks #3 again.
ra...@gmail.com <ra...@gmail.com> #6
App Crash at
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
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
ap...@google.com <ap...@google.com> #7
With reference to comment #4 , issue is resolved by implementing suggested changes in comment #3 . Can you please confirm if we need to still investigate this issue ?
wi...@google.com <wi...@google.com> #8
Yes. textView.layoutDirection = textView.layoutDirection(>= API17) or ViewCompat.setLayoutDirection(textView, ViewCompat.getLayoutDirection(textView)) will resolve this bug.
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
https://medium.com/google-developers/prefetch-text-layout-in-recyclerview-4acf9103f438 '
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)
https://developer.android.com/reference/androidx/appcompat/widget/AppCompatTextView.html#setTextFuture(java.util.concurrent.Future%3Candroidx.core.text.PrecomputedTextCompat%3E)
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!
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!
da...@allaboutapps.at <da...@allaboutapps.at> #9
I think should handle setLayoutDirection in the AppcompatTextView when setTextFuture, it will simpler for dev when implement TextFuture.
gb...@jeniusbank.com <gb...@jeniusbank.com> #10
We have passed this to the development team and will update this issue with more information as it becomes available.
gb...@manubank.com <gb...@manubank.com> #11
Fix released with appCompat 1.0.2, core 1.0.1
se...@gmail.com <se...@gmail.com> #12
Similar request has been raised in another bug in Android AOSP external tracker in b/123131632 .
Description shared by an external reporter:
================================
1.
Version used: androidx.appcompat:appcompat:1.1.0-alpha1
AppCompatTextView.setTextFuture
http://crashes.to/s/a9335204277
i foundhttps://issuetracker.google.com/issues/113070424 say version 1.0.2 fixed, But it still exists。
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 detailhttp://crashes.to/s/a9335204277
===========================================
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.
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.
kb...@jaguarlandrover.com <kb...@jaguarlandrover.com> #13
Please ignore comment #12 .
ca...@greenfly.com <ca...@greenfly.com> #14
Comment has been deleted.
je...@veo.co <je...@veo.co> #16
Hi, I got the same crash after updating my application to target SDK level 33, after changing my splash screen dependency to the 1.1.0-alpha01 version I get this error:
Dependency 'androidx.core:core-splashscreen:1.1.0-alpha01' requires libraries and applications that
depend on it to compile against codename "UpsideDownCake" of the
Android APIs.
:app is currently compiled against android-33.
Recommended action: Use a different version of dependency 'androidx.core:core-splashscreen:1.1.0-alpha01',
or set compileSdkPreview to "UpsideDownCake" in your build.gradle
file if you intend to experiment with that preview SDK.
Any idea why this is happening?
Dependency 'androidx.core:core-splashscreen:1.1.0-alpha01' requires libraries and applications that
depend on it to compile against codename "UpsideDownCake" of the
Android APIs.
:app is currently compiled against android-33.
Recommended action: Use a different version of dependency 'androidx.core:core-splashscreen:1.1.0-alpha01',
or set compileSdkPreview to "UpsideDownCake" in your build.gradle
file if you intend to experiment with that preview SDK.
Any idea why this is happening?
wi...@google.com <wi...@google.com> #17
al...@google.com <al...@google.com> #18
Releases from androidx-platform-dev
during the Android 14 pre-release timeline were built against preview SDKs and can only be compiled against the same preview SDKs.
You will need to run a new release from androidx-main
.
je...@veo.co <je...@veo.co> #19
What's the timeline on releasing the correct version of the patch?
wi...@google.com <wi...@google.com>
an...@gmail.com <an...@gmail.com> #20
Hi, I got the same issue.
ap...@google.com <ap...@google.com> #21
Project: platform/frameworks/support
Branch: androidx-main
commit 6ec30b56541bdc314f59f6564ca5122b535719c7
Author: wilsonshih <wilsonshih@google.com>
Date: Tue Aug 29 10:24:39 2023
Bump library version for core-splashscreen to 1.1.0-alpha02
Bug: 243457485
Test: NA
Change-Id: I7fc30ffe933609711e7f430238ede1c7565f14a3
M libraryversions.toml
https://android-review.googlesource.com/2730273
Branch: androidx-main
commit 6ec30b56541bdc314f59f6564ca5122b535719c7
Author: wilsonshih <wilsonshih@google.com>
Date: Tue Aug 29 10:24:39 2023
Bump library version for core-splashscreen to 1.1.0-alpha02
Bug: 243457485
Test: NA
Change-Id: I7fc30ffe933609711e7f430238ede1c7565f14a3
M libraryversions.toml
wi...@google.com <wi...@google.com> #22
1.1.0-alpha02
scheduled on September 7, 2023
wi...@google.com <wi...@google.com> #23
Comment has been deleted.
wi...@google.com <wi...@google.com>
ru...@gmail.com <ru...@gmail.com> #24
Is there any official estimated time to release a stable version including this fix? I don't want to have an alpha version in my production app. Or should I stop using the Splashscreen library?
ni...@flycatcherapps.com <ni...@flycatcherapps.com> #25
What is the estimated time to see this fix in production? Splash screen core 1.1.0-alpha02 was released on Sep 06, 2023 and no update since that time.
na...@google.com <na...@google.com> #26
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.core:core-splashscreen:1.2.0-alpha01
ro...@gmail.com <ro...@gmail.com> #27
Is there any updates ? still got null(iconView) Android 13
ro...@gmail.com <ro...@gmail.com> #28
Android 12 also has the same issue
wi...@google.com <wi...@google.com> #29
Re #27, mind provide a sample app? and what's version of library?
rh...@gmail.com <rh...@gmail.com> #30
Having the same issue.. can this be released in a stable release? Our team would definitely prefer not to opt into an alpha version for use in an enterprise production environment.
Description
Component used: SplashScreen Version used: 1.0.0-rc01 Devices/Android versions reproduced on: 100% Android 13
Artifact used: androidx.core:core-splashscreen Theme used: Theme.SplashScreen Crash Reproducible: False Devices/Android versions reproduced on: Pixel 4a (5G) (Android 13), Pixel 6/6 PRO
crash logs:
Fatal Exception: java.lang.NullPointerException at androidx.core.splashscreen.SplashScreenViewProvider$ViewImpl31.getIconView(SplashScreenViewProvider.kt:125) at androidx.core.splashscreen.SplashScreenViewProvider.getIconView(SplashScreenViewProvider.java:66) at fm.dice.splash.presentation.views.SplashActivity.triggerViewExitAnimation$lambda-0(SplashActivity.java:101) at fm.dice.discount.presentation.views.EventClaimCodeActivity$$InternalSyntheticLambda$2$e3b1050cf4cd59cef767f70a2238c7fe944dade6077bc18a7c181ca18936655c$0.onAnimationUpdate$bridge(EventClaimCodeActivity.java:9) at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1653) at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:775) at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:738) at android.animation.ValueAnimator.start(ValueAnimator.java:1170) at android.animation.ValueAnimator.start(ValueAnimator.java:1189) at fm.dice.splash.presentation.views.SplashActivity.triggerViewExitAnimation(SplashActivity.java:117) at fm.dice.splash.presentation.views.SplashActivity.access$triggerViewExitAnimation(SplashActivity.java:49) at fm.dice.splash.presentation.views.SplashActivity$onCreate$1.onSplashScreenExit(SplashActivity.kt:83) at androidx.core.splashscreen.SplashScreen$Impl31.setOnExitAnimationListener$lambda-0(SplashScreen.kt:459) at androidx.core.splashscreen.SplashScreen$Impl31.$r8$lambda$_AQ1xSddL7-kLq4WrGTBd4lTQaY(SplashScreen.kt:29) at androidx.core.splashscreen.SplashScreen$Impl31$$InternalSyntheticLambda$1$761acc8e6019f840a6c78651dfd204d1aa5d02a4d0503ed9e876fedb200d42e5$0.onSplashScreenExit(SplashScreen.java:4) at android.window.SplashScreen$SplashScreenManagerGlobal.dispatchOnExitAnimation(SplashScreen.java:271) at android.window.SplashScreen$SplashScreenManagerGlobal.handOverSplashScreenView(SplashScreen.java:258) at android.app.ActivityThread.reportSplashscreenViewShown(ActivityThread.java:4147) at android.app.ActivityThread.lambda$syncTransferSplashscreenViewTransaction$1$android-app-ActivityThread(ActivityThread.java:4164) at android.app.ActivityThread$$ExternalSyntheticLambda5.run(ActivityThread.java:6) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239) at android.view.Choreographer.doCallbacks(Choreographer.java:899) at android.view.Choreographer.doFrame(Choreographer.java:827) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7898) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)