Status Update
Comments
tp...@gmail.com <tp...@gmail.com> #2
Branch: androidx-master-dev
commit c60f33e229e31ab328ef6b59dab63b264954831c
Author: Alexandre Elias <aelias@google.com>
Date: Fri Jul 10 16:23:09 2020
Semantics no-op cleanups
Partly in response to lmr's broad code review, I did a pass of
superficial API/implementation cleanup. The main changes are:
- I changed each Boolean SemanticsProperty where false is equivalent to
not being present to take "Unit" instead. This is conceptually
clearer: it avoids questions like "can I cancel out a semantics from a
merged child by setting it to false?" Because "property = Unit" looks
weird, I also changed the style of these to "property()".
- I moved the Semantics id generator closer to where it's used, in
SemanticsModifierCore. I made it internal and an AtomicInt.
(Note that integer ids are heavily used in the Android
AccessibilityNodeInfo APIs so I can't simply remove them entirely.)
- I deleted dead code. Some examples include SemanticsHintOverrides,
a public API not connected to anything, and SemanticsPropertyKey
merge() open method which is never called. (In both cases I have
a different plan in mind for accessibility.)
Fixes: 145951226
Fixes: 145955412
Test: existing tests
Relnote: "Single-value semantics properties now use a calling style.
For example, 'semantics { hidden = true }' is now written as:
'semantics { hidden() }'."
Change-Id: Ic1afd12ea22c926babc9662f1804d80b33aa0cfc
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/graphics/vector/VectorTest.kt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
D ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
M ui/ui-foundation/api/0.1.0-dev15.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev15.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
M ui/ui-text/api/0.1.0-dev15.txt
M ui/ui-text/api/current.txt
M ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-text/api/public_plus_experimental_current.txt
M ui/ui-text/api/restricted_0.1.0-dev15.txt
M ui/ui-text/api/restricted_current.txt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
il...@google.com <il...@google.com> #3
Please include a sample project that reproduces your issue. None of the room-paging
artifacts have any strict dependencies on Paging.
du...@google.com <du...@google.com> #4
There shouldn't be a strict version requirement, room-paging depending on paging-common:3.1.1 should be able to get upgraded to 3.2.0-alpha01.
By any chance are you hitting this while running an instrumented test? The version of paging should resolve the same between for both the main apk and test apk, but the way this is exposed is unfortunately as a version requirement.
Otherwise, if you can share your build.gradle
it would help us reproduce the issue, it's possible we're missing a version constraint that could better guide how Gradle resolves the paging-common version.
tp...@gmail.com <tp...@gmail.com> #5
Hi, no we are not using during instrumented test but just a normal run from AS will encounter the crash.
Not sure what went wrong but excluding the transitive dependency group androidx.paging from room-paging seems to work and androidx.paging:paging-common:3.1.1 no longer shown as strictly in the app:dependencies task.
il...@google.com <il...@google.com> #6
If you're able to reproduce this in a sample project, please attach it here and we can reopen the issue and take a look.
fr...@gmail.com <fr...@gmail.com> #7
I also ran into this, it is fairly easy to reproduce on my end. I need to add dependency on both paging-runtime
and paging-compose
:
implementation 'androidx.paging:paging-runtime:3.1.1'
implementation 'androidx.paging:paging-compose:1.0.0-alpha15'
And then eg. creating a PagingDataAdapter
will cause a crash:
val adapter = object : PagingDataAdapter<String, RecyclerView.ViewHolder>(object : DiffUtil.ItemCallback<String>() {
override fun areItemsTheSame(oldItem: String, newItem: String) = true
override fun areContentsTheSame(oldItem: String, newItem: String) = true
}) {
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) = TODO()
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = TODO()
}
java.lang.NoSuchMethodError: No direct method <init>(Landroidx/paging/DifferCallback;Lkotlinx/coroutines/CoroutineDispatcher;)V in class Landroidx/paging/PagingDataDiffer; or its super classes (declaration of 'androidx.paging.PagingDataDiffer' appears in /data/app/~~QVBQXUo_41J0PPyeyQkLkA==/com.example.pagingcrashrepro-b6_Qq8aKQlwtI2MEGllfnw==/base.apk)
at androidx.paging.AsyncPagingDataDiffer$differBase$1.<init>(AsyncPagingDataDiffer.kt:78)
at androidx.paging.AsyncPagingDataDiffer.<init>(AsyncPagingDataDiffer.kt:78)
at androidx.paging.PagingDataAdapter.<init>(PagingDataAdapter.kt:78)
at androidx.paging.PagingDataAdapter.<init>(PagingDataAdapter.kt:61)
at com.example.pagingcrashrepro.MainActivity$onCreate$adapter$1.<init>(MainActivity.kt:17)
at com.example.pagingcrashrepro.MainActivity.onCreate(MainActivity.kt:17)
at android.app.Activity.performCreate(Activity.java:8054)
at android.app.Activity.performCreate(Activity.java:8034)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1341)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3666)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3842)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
If I downgrade paging dependency to alpha14
, the crash does not happen.
du...@google.com <du...@google.com> #8
You must use paging 3.2.0-alpha01
with paging-compose:1.0.0-alpha15
.
fr...@gmail.com <fr...@gmail.com> #9
You must use paging
3.2.0-alpha01
withpaging-compose:1.0.0-alpha15
.
Ok, then I have a couple of follow ups, in no particular order:
- Is this documented somewhere?
- Why does it not fail at compile time, instead of runtime?
- Why doesn't
paging-compose:1.0.0-alpha15
then force the other dependency to update to3.2.0-alpha01
? - If there is no other way that to fail at runtime, could there be a better error message at least?
il...@google.com <il...@google.com> #10
Re
If you have a sample project where you are not seeing that happen automatically, please attach it here.
il...@google.com <il...@google.com> #12
This is more of an issue with Gradle than anything else - leaving out the dependency on paging-runtime
would automatically upgrade you to the correct version of paging-common
, but your explicit dependency overrides that default behavior.
Gradle does offer the ability to set constrants, which would help enforce this even if you do explicitly set the wrong version. We can add that between paging-common
and paging-compose
.
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit e44aa3ffaf00622674ef7dec7ad63be0b03b3f16
Author: Clara Fok <clarafok@google.com>
Date: Tue Jul 19 16:59:26 2022
Add project dependency constraint between paging-common and paging runtime
Added bi-directional project version constraint between paging-common and paging-runtime. If both artifacts are in the dependency tree,
they would have to be on the same version. This is enforced by gradle automatically bumping up the version to meet constraint.
Before constraint added, with direct dependency on paging-runtime:3.1.1 and paging-common:3.2.0-alpha02
+--- androidx.paging:paging-runtime:3.1.1
| +--- androidx.paging:paging-common:3.1.1 -> 3.2.0-alpha02
After constraint with direct dependency on paging-runtime:3.1.1 and paging-common:3.2.0-alpha02
+--- androidx.paging:paging-runtime:3.1.1 -> 3.2.0-alpha02
| +--- androidx.paging:paging-common:3.2.0-alpha02
Test: n/a
Bug: 235256201
Change-Id: I0eb1f099edc626519fa3468e428313b185d105c9
M paging/paging-runtime/build.gradle
M paging/paging-common/build.gradle
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit 0b7b59589d3722cc2c4491437f6e27fa0a8d1fc8
Author: Clara Fok <clarafok@google.com>
Date: Tue Jul 19 17:52:02 2022
Add project dependency constraint between paging-common and paging-compose
Added bi-directional project constraint between paging-common and paging-compose. This is necessary because recent features added in common and compose requires these two strict matches:
(common:3.2.0-alpha01) with (compose:1.0.0-alpha15) for
(common:3.2.0-alpha02) with (compose:1.0.0-alpha16) for
As such, project constraint is used to ensure that, regardless of which common version is used, the relevant ToT compose will be set as constraint.
Example: Lower compose version with higher common version
Before constraint added, paging-compose:1.0.0-alpha14 with paging-common:3.2.0-alpha01
+--- androidx.paging:paging-compose:1.0.0-alpha14
+--- androidx.paging:paging-common:3.1.0-beta01 -> 3.2.0-alpha01 (*)
After constraint, paging-compose:1.0.0-alpha14 and paging-common:3.2.0-alpha02
+--- androidx.paging:paging-compose:1.0.0-alpha14 -> 1.0.0-alpha16
+--- androidx.paging:paging-common:3.2.0-alpha02 (*)
Example: Higher compose version with lower common version
Before constraint added, paging-compose:1.0.0-alpha16 with paging-common:3.2.0-alpha01
+--- androidx.paging:paging-compose:1.0.0-alpha16
+--- androidx.paging:paging-common:3.2.0-alpha01
After constraint, paging-compose:1.0-0-alpha16 with paging-common:3.2.0-alpha01
+--- androidx.paging:paging-compose:1.0.0-alpha16
+--- androidx.paging:paging-common:3.2.0-alpha01 -> 3.2.0-alpha02
Test: n/a
Fixes: 235256201
Fixes: 239868768
Change-Id: Ifbe86432341d2d4c18fd105b713f454acdaa5b22
M paging/paging-compose/build.gradle
M paging/paging-common/build.gradle
Description
Hi, encountered java.lang.NoSuchMethodError: crash right after upgrading paging compose version to 1.0.0-alpha15
Upon inspecting the source code locally, noticed that the pagingDataDiffer in class LazyPagingItems is calling the PagingDataDiffer new constructor with mainContext as the named argument.
But the PagingDataDiffer class in the lib is having the old constructor argument mainDispatcher
Component used: Paging Compose
Version used: 1.0.0-alpha15
Devices/Android versions reproduced on: All
Build: AI-212.5712.43.2112.8609683, 202205181650,
AI-212.5712.43.2112.8609683, JRE 11.0.12+0-b1504.28-7817840x64 JetBrains s.r.o., OS Mac OS X(x86_64) v12.4, screens 2880.0x1800.0, 1920.0x1080.0; Retina
AS: Chipmunk | 2021.2.1 Patch 1; Kotlin plugin: 212-1.6.21-release-334-AS5457.46; Android Gradle Plugin: 7.2.1; Gradle: 7.4.1; Gradle JDK: version 11.0.12; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: 3.18.1-g262b901, from PATH: (not found)
IMPORTANT: Please readhttps://developer.android.com/studio/report-bugs.html carefully and supply all required information.