Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Screenshot tests are currently not running correctly

未关闭
#81 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
kotlin
领域
testing-qa

调研方向

首先运行 ./gradlew updateDebugScreenshotTest,并检查 :feature:results:updateDebugScreenshotTest 显示的失败,包括 ClassNotFoundException 和 render-measure 错误。在 screenshot-test-fix 分支上跟踪截图测试的设置;任务成功完成且全部 8 个测试通过后,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Currently the screenshots are no longer running with the latest screenshot test update.

Enabled them in this https://github.com/android/androidify/tree/screenshot-test-fix
but running the updateDebugScreenshot test fails with a few issues.

Documenting the issue here for now until we can fix it properly:

./gradlew updateDebugScreenshotTest
Reusing configuration cache.

> Task :feature:results:updateDebugScreenshotTest
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by com.android.tools.rendering.security.RenderSecurityManager (file:/Users/riggaroo/.gradle/caches/modules-2/files-2.1/com.android.tools.compose/compose-preview-renderer/0.0.1-alpha10/a3b3bc879a3c1ae5a41ed671e00a134212289be9/compose-preview-renderer-0.0.1-alpha10.jar)
WARNING: Please consider reporting this to the maintainers of com.android.tools.rendering.security.RenderSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
java.lang.ClassNotFoundException: android.view.HardwareCanvas
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1023)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
        at java.base/jdk.internal.loader.BuiltinClassLoader$4.run(BuiltinClassLoader.java:773)
        at java.base/jdk.internal.loader.BuiltinClassLoader$4.run(BuiltinClassLoader.java:768)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:781)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at androidx.compose.ui.graphics.layer.GraphicsViewLayer.<clinit>(GraphicsViewLayer.android.kt:516)
        at androidx.compose.ui.graphics.AndroidGraphicsContext.createGraphicsLayer(AndroidGraphicsContext.android.kt:137)
        at androidx.compose.foundation.MarqueeModifierNode.onAttach(BasicMarquee.kt:241)
        at androidx.compose.ui.Modifier$Node.runAttachLifecycle$ui_release(Modifier.kt:266)
        at androidx.compose.ui.node.NodeChain.runAttachLifecycle(NodeChain.kt:283)
        at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:554)
        at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:552)
        at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:552)
        at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:552)
        at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:552)
        at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:552)
        at androidx.compose.ui.node.LayoutNode.attach$ui_release(LayoutNode.kt:552)
        at androidx.compose.ui.node.LayoutNode.insertAt$ui_release(LayoutNode.kt:310)
        at androidx.compose.ui.node.UiApplier.insertBottomUp(UiApplier.android.kt:29)
        at androidx.compose.ui.node.UiApplier.insertBottomUp(UiApplier.android.kt:21)
        at androidx.compose.runtime.changelist.Operation$PostInsertNodeFixup.execute(Operation.kt:776)
        at androidx.compose.runtime.changelist.Operation.executeWithComposeStackTrace(Operation.kt:62)
        at androidx.compose.runtime.changelist.Operations.executeAndFlushAllPendingOperations(Operations.kt:350)
        at androidx.compose.runtime.changelist.FixupList.executeAndFlushAllPendingFixups(FixupList.kt:54)
        at androidx.compose.runtime.changelist.Operation$InsertSlotsWithFixups.execute(Operation.kt:682)
        at androidx.compose.runtime.changelist.Operation.executeWithComposeStackTrace(Operation.kt:62)
        at androidx.compose.runtime.changelist.Operations.executeAndFlushAllPendingOperations(Operations.kt:350)
        at androidx.compose.runtime.changelist.ChangeList.executeAndFlushAllPendingChanges(ChangeList.kt:90)
        at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:1091)
        at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1131)
        at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:1243)
        at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:692)
        at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:633)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:123)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:114)
        at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:1994)
        at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:114)
        at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:168)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.jvm.kt:313)
        at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.jvm.kt:191)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:121)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:114)
        at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:2081)
        at android.view.View.dispatchAttachedToWindow(View.java:22895)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3506)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3513)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3513)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3513)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3513)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3513)
        at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:69)
        at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:361)
        at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:462)
        at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:125)
        at com.android.tools.rendering.RenderTask.createRenderSession(RenderTask.java:829)
        at com.android.tools.rendering.RenderTask.lambda$inflate$7(RenderTask.java:977)
        at com.android.tools.rendering.RenderExecutor$runAsyncActionWithTimeout$2.run(RenderExecutor.kt:217)
        at com.android.tools.rendering.RenderExecutor$PriorityRunnable.run(RenderExecutor.kt:338)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1570)
ScreenshotError(status=ERROR_NOT_INFLATED, message=, stackTrace=, problems=[], brokenClasses=[], missingClasses=[])
ScreenshotError(status=SUCCESS, message=, stackTrace=, problems=[RenderProblem(html=View measure failed (<A HREF="">Details</A>), stackTrace=java.lang.NullPointerException
        at androidx.compose.ui.node.LookaheadPassDelegate.forEachChildAlignmentLinesOwner(LookaheadPassDelegate.kt:343)
        at androidx.compose.ui.node.LookaheadPassDelegate.remeasure-BRTryo0(LookaheadPassDelegate.kt:467)
        at androidx.compose.ui.node.LookaheadPassDelegate.measure-BRTryo0(LookaheadPassDelegate.kt:398)
        at androidx.compose.foundation.layout.BoxMeasurePolicy.measure-3p2s80s(Box.kt:168)
        at androidx.compose.ui.node.InnerNodeCoordinator$LookaheadDelegateImpl.measure-BRTryo0(InnerNodeCoordinator.kt:82)
        at androidx.compose.animation.SharedTransitionScopeKt$SharedTransitionScope$1$1$1.invoke-3p2s80s(SharedTransitionScope.kt:128)
        at androidx.compose.animation.SharedTransitionScopeKt$SharedTransitionScope$1$1$1.invoke(SharedTransitionScope.kt:127)
        at androidx.compose.ui.layout.LayoutModifierImpl.measure-3p2s80s(LayoutModifier.kt:278)
        at androidx.compose.ui.node.LayoutModifierNodeCoordinator$LookaheadDelegateForLayoutModifierNode.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:93)
        at androidx.compose.ui.node.LookaheadPassDelegate$performMeasure$1.invoke(LookaheadPassDelegate.kt:438)
        at androidx.compose.ui.node.LookaheadPassDelegate$performMeasure$1.invoke(LookaheadPassDelegate.kt:437)
        at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:502)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:464)
        at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:248)
        at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(OwnerSnapshotObserver.kt:124)
     

Test run finished after 12355 ms
[        13 containers found      ]
[         0 containers skipped    ]
[        13 containers started    ]
[         0 containers aborted    ]
[        13 containers successful ]
[         0 containers failed     ]
[         8 tests found           ]
[         0 tests skipped         ]
[         8 tests started         ]
[         0 tests aborted         ]
[         6 tests successful      ]
[         2 tests failed          ]


> Task :feature:results:updateDebugScreenshotTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':feature:results:updateDebugScreenshotTest'.
> Process 'command '/Library/Java/JavaVirtualMachines/zulu-22.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 32s
191 actionable tasks: 15 executed, 176 up-to-date
主要语言
Kotlin
星标
2k
派生
313
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

android/androidify 的其他 Issue

查看 android/androidify 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。