Status Update
Comments
ae...@google.com <ae...@google.com> #2
Branch: androidx-main
commit a330c0d3bcdd41326f37968a60e6084ad4a2e32c
Author: Chet Haase <chet@google.com>
Date: Wed Jul 05 07:26:46 2023
Convert APIs using PointF to use Float instead
PointF is a convenient mechanism for passing around x.y values
representing 2D points. But there are downsides, including:
- Converting to PointF: You may not have the data in PointF form
to begin with, so using an API which takes PointF requires converting
the data to that form (including allocating a PointF object every time)
- Mutability: Point structures can be mutated internally, causing
unpredictability in what that mutation means. Should the library
react to those changes? Ignore them? Do defensive copies (requiring
even more allocations)? Using primitive types like Float make the
behavior more obvious (by making the data inherently immutable).
- Allocations: Whenever we use object types, there are necessarily
allocations on the Java heap for them. This puts pressure on the GC
at both allocation and collection time. Given the amount of points
being passed around (especially at morph creation time, when curves
are being split and created), this causes a lot of PointF objects to
be allocated (even temporarily). Using Float avoids that problem.
Also fixed bug with unclosed paths causing discontinuity at the
start/end point.
Bug: 276466399
Bug: 290254314
Test: integration and unit tests pass
Relnote: PointF parameters changed to Float pairs
Change-Id: Id4705d27c7be31b26ade8186b99fffe2e2f8450e
M graphics/graphics-shapes/api/current.txt
M graphics/graphics-shapes/api/restricted_current.txt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/CubicShapeTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/CubicTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/PolygonMeasureTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/PolygonTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/RoundedPolygonTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/ShapesTest.kt
M graphics/graphics-shapes/src/androidTest/java/androidx/graphics/shapes/TestUtils.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Cubic.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/CubicShape.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/FeatureMapping.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/FloatMapping.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Morph.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/PolygonMeasure.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/RoundedPolygon.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Shapes.kt
M graphics/graphics-shapes/src/main/java/androidx/graphics/shapes/Utils.kt
M graphics/integration-tests/testapp-compose/src/main/java/androidx/graphics/shapes/testcompose/DebugDraw.kt
M graphics/integration-tests/testapp-compose/src/main/java/androidx/graphics/shapes/testcompose/ShapeEditor.kt
M graphics/integration-tests/testapp/src/main/java/androidx/graphics/shapes/test/MaterialShapes.kt
tp...@gmail.com <tp...@gmail.com> #3
tp...@gmail.com <tp...@gmail.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.graphics:graphics-shapes:1.0.0-alpha04
tp...@gmail.com <tp...@gmail.com> #5
Hi all, some updates for this issue, from our crashlytics noticed that adding the post { } block still causes the same crash on 100% Android 7 Samsung devices when calling animatable.start() with AndroidView.
Crash is happening for Note 5 and S6, S6 edge and edge+ devices as per screenshot attached.
May I check if there are any updates regarding this issue?
ma...@gmail.com <ma...@gmail.com> #6
This also happens on OnePlus 7 Pro running LineageOS
th...@gmail.com <th...@gmail.com> #7
I am running into the same issue with my Compose app on Wear OS. Samsung Galaxy Watch4. Could this please be fixed?
Similar issue:
java.lang.NullPointerException
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:292)
at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:857)
at android.view.View.draw(View.java:22879)
at android.view.View.updateDisplayListIfDirty(View.java:21744)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4537)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4509)
at android.view.View.updateDisplayListIfDirty(View.java:21698)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4537)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4509)
at android.view.View.updateDisplayListIfDirty(View.java:21698)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4537)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4509)
at android.view.View.updateDisplayListIfDirty(View.java:21698)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:559)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:565)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:642)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4270)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3983)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3231)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2048)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8575)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:998)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:731)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:983)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:7690)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
st...@google.com <st...@google.com> #8
Re
th...@gmail.com <th...@gmail.com> #9
I have not been able to create a sample for the crash with Wear Compose. What I did find out is that if I remove PositionIndicator
from my code the crash no longer occurs. See also:
st...@google.com <st...@google.com> #10
Thomas, is your code also using AnimatedVectorDrawables like the example in the original report?
We are using AVDs in a dialog sample, but I haven't seen that error - perhaps you could test it on your devices to see if it can trigger the exception?
th...@gmail.com <th...@gmail.com> #11
AnimatedVectorDrawables
work fine on the Galaxy Watch4. I am actually using the sample for the open on phone animation you linked in my project already, which works without any issues.
nj...@google.com <nj...@google.com> #12
I have tried the sample github project in
I recommend updating to the latest version of compose or providing a more minimal sample application for the team to look into.
tp...@gmail.com <tp...@gmail.com> #13
Are you running the sample on specific device? The github project is crashing only on Huawei devices running Android 10 or certain android 7 devices. I have tried it again on emulator running on Android 7 API 24 also able to reproduce the crash. Video as attached.
2022-01-13 14:09:57.183 3991-3991/com.terence.composeTest E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.terence.composeTest, PID: 3991
java.lang.NullPointerException
at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.android.kt:245)
at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.android.kt:760)
at android.view.View.draw(View.java:17074)
at android.view.View.updateDisplayListIfDirty(View.java:16053)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
at android.view.View.updateDisplayListIfDirty(View.java:16016)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
at android.view.View.updateDisplayListIfDirty(View.java:16016)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
at android.view.View.updateDisplayListIfDirty(View.java:16016)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
at android.view.View.updateDisplayListIfDirty(View.java:16016)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
at android.view.View.updateDisplayListIfDirty(View.java:16016)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
at android.view.View.updateDisplayListIfDirty(View.java:16016)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
at android.view.View.updateDisplayListIfDirty(View.java:16016)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
at android.view.View.updateDisplayListIfDirty(View.java:16016)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
at android.view.View.updateDisplayListIfDirty(View.java:16016)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:656)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:662)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:770)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2796)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2604)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2211)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6301)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
at android.view.Choreographer.doCallbacks(Choreographer.java:683)
at android.view.Choreographer.doFrame(Choreographer.java:619)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
2022
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit f4ad578674a55af824e19d6e921dcd68f5eeff82
Author: Nader Jawad <njawad@google.com>
Date: Wed Jan 12 16:10:47 2022
Add defensive null check
Add conditional let block within
logic to record drawing operations
in case the displaylist for a RenderNodeLayer
is attempted to be updated after the layer
has been destroyed
Fixes: 206677462
Test: re-ran compose tests
Change-Id: I838d3170547716fa35d6e9b630db995075e814d9
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/RenderNodeLayer.android.kt
to...@branchapp.com <to...@branchapp.com> #15
ri...@ffw.com <ri...@ffw.com> #16
th...@gmail.com <th...@gmail.com> #17
Thanks for the fix! I can confirm it works with the latest snapshot in my Wear OS app.
lc...@gmail.com <lc...@gmail.com> #18
Can this fix be ported to 1.1.0 version too? i see that its currently onl in 1.2.0-alpha02
fr...@instacart.com <fr...@instacart.com> #19
+1, this is forcing us to downgrade compose and kotlin, this needs to be in 1.1
be...@google.com <be...@google.com> #20
This fix has been cherry picked to 1.1.1 as well
na...@google.com <na...@google.com> #21
The following release(s) address this bug:
androidx.compose.ui:ui:1.3.0
Description
Hello, noticed a NPE crash in compose ui after updating from 1.1.0-alpha05 to 1.1.0-beta01. Crash happening in RenderNodeLayer.updateDisplayList and happening 100% on Android 10 Huawei devices as reported on crashlytics. Initially thought it was due to code obfuscation issue but managed to replicate it consistently on a non obfuscated build.
Noticed from the stacktrace that somehow drawBlock in updateDisplayList is null but not sure in what scenarios it could become null?