Status Update
Comments
dh...@gmail.com <dh...@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
cc...@google.com <cc...@google.com> #3
If androidx.benchmark.dropShaders.enable=false
works as a workaround, that means that your app may have added the 1.3.0 profileinstaller dependency, but for some reason the broadcast receiver isn't available in your apps manifest, likely due to an issue with manifest merging.
See if that can be enabled, you should see an entry like this when you open up your target app (whichever variant you're benchmarking) in studio:
Note that if you're not using AGP, and your build system doesn't do this for you, you may need to manually add this to a manifest for your benchmark variant, or keep using that workaround.
ra...@gmail.com <ra...@gmail.com> #4
cc...@google.com <cc...@google.com> #5
If you have a dependency on Profileinstaller 1.3, you should see that ProfileInstallReciever
entry in your manifest, including the BENCHMARK_OPERATION
action, you should be able to run the following (put in your package name):
adb shell am broadcast -a androidx.profileinstaller.action.BENCHMARK_OPERATION -e EXTRA_BENCHMARK_OPERATION DROP_SHADER_CACHE <YOURPACKAGENAME>/androidx.profileinstaller.ProfileInstallReceiver
And you should see the following:
Broadcasting: Intent { act=androidx.profileinstaller.action.BENCHMARK_OPERATION flg=0x400000 cmp=androidx.benchmark.integration.macrobenchmark.target/androidx.profileinstaller.ProfileInstallReceiver (has extras) }
Broadcast completed: result=14
This is what benchmark does to trigger dropping shaders, and 14
means it succeeded.
- What does that command output for you?
- If it fails, can you paste logcat for the time when the command is run?
- If it fails, do you see the androidx.profileinstaller.ProfileInstallReceiver class in your apk's dex (unobfuscated), when you open your apk Android Studio?
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit 848e10c880906450666347d209e8feb7cd2e7e67
Author: Chris Craik <ccraik@google.com>
Date: Mon Apr 15 14:12:03 2024
Add extra debugging suggestions to drop shader failure message
Bug: 325502725
Bug: 322294291
Test: ProfileInstallBroadcastTest
Relnote: "Added extra debugging suggestions to drop shader broadcast
failure message."
Also removed perfetto tracing from ProfileInstallBroadcastTest to
significantly improve perf (~9s -> ~2s).
Change-Id: I5efa660caabba1e9367aeabfd48b320dca41eed1
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/Packages.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/ProfileInstallBroadcastTest.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/ProfileInstallBroadcast.kt
Description
Component used: Macrobenchmark Version used: AGP - v7.3.0 Profile Installer - v1.3.1 Devices/Android versions reproduced on: Vivo V2029, Android 12
I am trying to setup macrobenchmarking on my app which has multiple modules and multiple flavors and following the android developer guide. However, I am getting below error related to DROP_SHADER_CACHE even though I have added profileInstaller dependency on the target app.
com.example.macrobenchmark.ExampleStartupBenchmark > startup[V2029 - 12] FAILED java.lang.IllegalStateException: The DROP_SHADER_CACHE broadcast was not received. This most likely means that thehttps://developer.android.com/jetpack/androidx/releases/profileinstaller .
at androidx.benchmark.macro.MacrobenchmarkScope.dropShaderCache(MacrobenchmarkScope.kt:286)
androidx.profileinstaller
library used by the target apk is old. Please use1.3.0-alpha02
or newer. For more information refer to the release notes atI am using Android Gradle Plugin v7.3.0 and Profile Installer v1.3.1
Below error comes while running benchmark tests.
I have observed that APP installed as part of the above process crashes on launch. This might be the reason of above error.
Stacktrace of App Crash
2024-02-15 16:19:27.752 9069-9099 TestRunner com.example.macrobenchmark E failed: startup(com.example.macrobenchmark.ExampleStartupBenchmark) 2024-02-15 16:19:27.752 9069-9099 TestRunner com.example.macrobenchmark E ----- begin exception ----- 2024-02-15 16:19:27.774 9069-9099 TestRunner com.example.macrobenchmark E java.lang.IllegalStateException: The DROP_SHADER_CACHE broadcast was not received. This most likely means that thehttps://developer.android.com/jetpack/androidx/releases/profileinstaller .
at androidx.benchmark.macro.MacrobenchmarkScope.dropShaderCache(MacrobenchmarkScope.kt:286)
at androidx.benchmark.macro.MacrobenchmarkKt$macrobenchmarkWithStartupMode$1.invoke(Macrobenchmark.kt:440)
at androidx.benchmark.macro.MacrobenchmarkKt$macrobenchmarkWithStartupMode$1.invoke(Macrobenchmark.kt:422)
at androidx.benchmark.macro.MacrobenchmarkKt$macrobenchmark$measurements$1.invoke(Macrobenchmark.kt:251)
at androidx.benchmark.macro.MacrobenchmarkKt$macrobenchmark$measurements$1.invoke(Macrobenchmark.kt:241)
at androidx.benchmark.perfetto.PerfettoTraceProcessor$Companion.runServer(PerfettoTraceProcessor.kt:105)
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmark(Macrobenchmark.kt:241)
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmarkWithStartupMode(Macrobenchmark.kt:422)
at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated(MacrobenchmarkRule.kt:107)
at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated$default(MacrobenchmarkRule.kt:97)
at com.example.macrobenchmark.ExampleStartupBenchmark.startup(ExampleStartupBenchmark.kt:30)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.benchmark.macro.junit4.MacrobenchmarkRule$applyInternal$1.evaluate(MacrobenchmarkRule.kt:133)
at androidx.test.rule.GrantPermissionRule$RequestPermissionStatement.evaluate(GrantPermissionRule.java:136)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:162)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:67)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:58)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:446)
2024-02-15 16:19:27.774 9069-9099 TestRunner com.example.macrobenchmark E at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2298)
2024-02-15 16:19:27.774 9069-9099 TestRunner com.example.macrobenchmark E ----- end exception -----
2024-02-15 16:19:27.787 9069-9099 TestRunner com.example.macrobenchmark I finished: startup(com.example.macrobenchmark.ExampleStartupBenchmark)
2024-02-15 16:19:27.796 9069-9099 TestRunner com.example.macrobenchmark I run finished: 1 tests, 1 failed, 0 ignored
2024-02-15 16:19:44.858 9792-9792 AndroidRuntime pid-9792 E FATAL EXCEPTION: main
Process: com.app.myapp, PID: 9792
java.lang.RuntimeException: Unable to instantiate application com.game.soulmate.MyApplication package com.app.myapp: java.lang.ClassNotFoundException: Didn't find class "com.game.soulmate.MyApplication" on path: DexPathList[[zip file "/data/app/~~J71UieQOQlumHrcdA8XIpg==/com.app.myapp-Jvagd_AD7yNyuIUNahByDQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~J71UieQOQlumHrcdA8XIpg==/com.app.myapp-Jvagd_AD7yNyuIUNahByDQ==/lib/arm, /data/app/~~J71UieQOQlumHrcdA8XIpg==/com.app.myapp-Jvagd_AD7yNyuIUNahByDQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/system_ext/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:1392)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7183)
at android.app.ActivityThread.access$1800(ActivityThread.java:284)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2284)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8399)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.game.soulmate.MyApplication" on path: DexPathList[[zip file "/data/app/~~J71UieQOQlumHrcdA8XIpg==/com.app.myapp-Jvagd_AD7yNyuIUNahByDQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~J71UieQOQlumHrcdA8XIpg==/com.app.myapp-Jvagd_AD7yNyuIUNahByDQ==/lib/arm, /data/app/~~J71UieQOQlumHrcdA8XIpg==/com.app.myapp-Jvagd_AD7yNyuIUNahByDQ==/base.apk!/lib/armeabi-v7a, /system/lib, /system/system_ext/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateApplication(AppComponentFactory.java:76)
at androidx.core.app.CoreComponentFactory.instantiateApplication(Unknown Source:0)
at android.app.Instrumentation.newApplication(Instrumentation.java:1227)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1384)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7183)
at android.app.ActivityThread.access$1800(ActivityThread.java:284)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2284)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.app.ActivityThread.main(ActivityThread.java:8399)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/react/ReactApplication;
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
... 15 more
Caused by: java.lang.ClassNotFoundException: com.facebook.react.ReactApplication
... 18 more
androidx.profileinstaller
library used by the target apk is old. Please use1.3.0-alpha02
or newer. For more information refer to the release notes at