Compose UI test setup
Sets up the right Gradle test dependencies for Jetpack Compose UI tests, so they launch instead of failing early.
What we improved
Removed a contradiction. The original told readers to put ui-test-manifest on testImplementation for Robolectric tests, but the androidx lint check it also relied on flags testImplementation, so following the rule failed the skill's own ver
Improved by YourAISkill from the original by skydoves, under its Apache-2.0 licence. The download includes the author's licence and a CHANGES.md listing every change. Both Claude reviews read the improved version.
Claude's review
8/10 Precise Compose test dependency matrix with error-to-cause table, app vs library host Activity rules, Hilt setup and verification steps.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Use this skill to wire the correct Gradle dependency matrix for Jetpack Compose UI tests. Covers `androidTestImplementation("androidx.compose.ui:ui-test-junit4")`, the `debugImplementation("androidx.compose.ui:ui-test-manifest")` requirement that makes `createComposeRule()` work, the host-test (Robolectric) trio, the accessibility add-ons (`ui-test-accessibility`, `ui-test-junit4-accessibility`), and the `TestManifestGradleConfiguration` lint warning. Use when the user reports `ActivityNotFoundException: ComponentActivity`, `createComposeRule unresolved`, `lint warning ui-test-manifest`, `Cannot find test rule`, or asks "what dependencies do I need for Compose UI tests" / "why won't my Compose test compile".
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: configuring-test-dependencies
description: >-
Wire the correct Gradle dependencies for Jetpack Compose UI tests, on device (androidTest) and on the JVM with Robolectric (test), and diagnose the failures a wrong setup causes. Covers ui-test-junit4 on the right source set, why ui-test-manifest must be debugImplementation (for Robolectric too), where a custom or Hilt test host Activity has to be declared in app modules versus library modules, includeAndroidResources and Robolectric SDK limits, the accessibility check artifacts, and the TestManifestGradleConfiguration lint warning (which cannot see version catalog entries). Use when a Compose test fails with "Unable to resolve activity for Intent ... ComponentActivity", ActivityNotFoundException or "Activity never becomes requested state", when createComposeRule or runComposeUiTest is unresolved, when lint flags ui-test-manifest, or when someone asks which dependencies Compose UI tests or Robolectric Compose tests need.
license: Apache-2.0. See LICENSE for complete terms.
metadata:
author: Jaewoong Eum (skydoves)
keywords:
- jetpack-compose
- ui-testing
- gradle-dependencies
- ui-test-manifest
- debug-implementation
- createComposeRule
- ComponentActivity
- ui-test-junit4
- robolectric
- accessibility-checks
---
<!-- Modified by YourAISkill (youraiskill.com) on 2 December 2026 from the original by skydoves. See CHANGES.md. -->
# Configuring Test Dependencies: Get the Gradle Matrix Right
Compose UI tests fail at the dependency layer in a few predictable ways: the JUnit4 artifact is on the wrong source set, `ui-test-manifest` is missing or on the wrong configuration, a custom host Activity is declared where the test cannot launch it, or the Robolectric setup is incomplete. This skill gives the matrix, explains why each line is where it is, and maps error messages to causes.
## When to use this skill
- A test fails at launch with `Unable to resolve activity for: Intent { ... cmp=<package>/androidx.activity.ComponentActivity }` or `ActivityNotFoundException` (on a device or under Robolectric).
- `createComposeRule`, `createAndroidComposeRule` or `runComposeUiTest` is unresolved, or the `androidx.compose.ui.test.junit4` import is red.
- Lint reports `TestManifestGradleConfiguration` on a `build.gradle.kts` line.
- Someone is adding Robolectric (JVM) tests for Compose and asks which artifacts they need.
- Someone wants `enableAccessibilityChecks()` and is unsure which artifact owns it.
- A screen under test needs a Hilt `@AndroidEntryPoint` host Activity.
Not this skill: choosing between `createComposeRule()` and `runComposeUiTest { }`, or flaky and timing out tests, once dependencies are correct.
## The matrix
```kotlin
dependencies {
...From skydoves's repository, Apache-2.0 licence.
Related skills
-
Checked
Android Gradle Plugin upgrade
Moves Kotlin Multiplatform projects to Android Gradle Plugin 9 and fixes the build failures it causes.
8/101 credit -
Checked
Android Edge-to-Edge Fix
Makes Jetpack Compose apps draw edge to edge, so buttons, lists and text fields never hide behind system bars.
8/101 credit -
Checked
Offline Android LLM apps
Builds an Android app that runs an open LLM on the phone with LiteRT, so it works without a server.
7/101 credit -
Checked
Android TV Compose Migration
Moves an Android TV app from old Leanback screens to Compose for TV, with remote control focus that works.
7/101 credit -
Checked
CometChat Android Chat Setup
Adds working CometChat chat screens to your Android app in Kotlin or Jetpack Compose, set up in the right order.
7/101 credit -
Checked
Kotlin Multiplatform Setup
Shares one Kotlin codebase across Android and iOS, with networking, a local database and tests that run on CI.
8/101 credit