Skip to content

Commit e424d4d

Browse files
authored
fix(build): add explicit compose-multiplatform-animation dependency (#5095)
1 parent 17d85c8 commit e424d4d

6 files changed

Lines changed: 29 additions & 1 deletion

File tree

.skills/project-overview/SKILL.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,31 @@ Meshtastic-Android is a Kotlin Multiplatform (KMP) application for off-grid, dec
6262
datadogClientToken=dummy_token
6363
```
6464

65-
## 5. Troubleshooting
65+
## 5. Workspace Bootstrap (MUST run before any build)
66+
Agents **MUST** perform these steps automatically at the start of every session before running any Gradle task. Do not wait for the user to tell you.
67+
68+
1. **Android SDK:** `ANDROID_HOME` may not be set in agent workspaces. Detect and export it:
69+
```bash
70+
# Check common macOS/Linux locations in order of preference
71+
if [ -z "$ANDROID_HOME" ]; then
72+
for dir in "$HOME/Library/Android/sdk" "$HOME/Android/Sdk" "/opt/android-sdk"; do
73+
if [ -d "$dir" ]; then export ANDROID_HOME="$dir"; break; fi
74+
done
75+
fi
76+
```
77+
All `./gradlew` invocations must include `ANDROID_HOME` in the environment. If the SDK cannot be found, ask the user for the path.
78+
79+
2. **Proto submodule:** `core/proto/src/main/proto` is a Git submodule containing Protobuf definitions. It must be initialized or builds will fail with proto generation errors:
80+
```bash
81+
git submodule update --init
82+
```
83+
84+
## 6. Troubleshooting
6685
- **Build Failures:** Check `gradle/libs.versions.toml` for dependency conflicts.
6786
- **Missing Secrets:** Check `local.properties` (see Environment Setup above).
6887
- **JDK Version:** JDK 21 is required.
88+
- **SDK location not found:** See Workspace Bootstrap step 1 above.
89+
- **Proto generation failures:** See Workspace Bootstrap step 2 above.
6990
- **Configuration Cache:** Add `--no-configuration-cache` flag if cache-related issues persist.
7091
- **Koin Injection Failures:** Verify the KMP component is included in `app` root module wiring (`AppKoinModule`).
7192

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ You are an expert Android and Kotlin Multiplatform (KMP) engineer working on Mes
2222
</context_and_memory>
2323

2424
<process>
25+
- **Workspace Bootstrap (MUST run first):** Before executing any Gradle task in a new workspace, agents MUST automatically:
26+
1. **Find the Android SDK**`ANDROID_HOME` is often unset in agent worktrees. Probe `~/Library/Android/sdk`, `~/Android/Sdk`, and `/opt/android-sdk`. Export the first one found. If none exist, ask the user.
27+
2. **Init the proto submodule** — Run `git submodule update --init`. The `core/proto/src/main/proto` submodule contains Protobuf definitions required for builds.
2528
- **Think First:** Reason through the problem before writing code. For complex KMP tasks involving multiple modules or source sets, outline your approach step-by-step before executing.
2629
- **Plan Before Execution:** Use the git-ignored `.agent_plans/` directory to write markdown implementation plans (`plan.md`) and Mermaid diagrams (`.mmd`) for complex refactors before modifying code.
2730
- **Atomic Execution:** Follow your plan step-by-step. Do not jump ahead. Use TDD where feasible (write `commonTest` fakes first).

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ dependencies {
243243
implementation(libs.jetbrains.compose.material3.adaptive.layout)
244244
implementation(libs.jetbrains.compose.material3.adaptive.navigation)
245245
implementation(libs.material)
246+
implementation(libs.compose.multiplatform.animation)
246247
implementation(libs.compose.multiplatform.material3)
247248
implementation(libs.compose.multiplatform.ui.tooling.preview)
248249
implementation(libs.compose.multiplatform.ui)

build-logic/convention/src/main/kotlin/KmpFeatureConventionPlugin.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class KmpFeatureConventionPlugin : Plugin<Project> {
4242
extensions.configure<KotlinMultiplatformExtension> {
4343
sourceSets.getByName("commonMain").dependencies {
4444
// Compose Multiplatform UI
45+
implementation(libs.library("compose-multiplatform-animation"))
4546
implementation(libs.library("compose-multiplatform-material3"))
4647

4748
// Lifecycle & ViewModel (JetBrains KMP forks — safe in commonMain)

core/ui/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ kotlin {
4242
implementation(projects.core.resources)
4343
implementation(projects.core.service)
4444

45+
implementation(libs.compose.multiplatform.animation)
4546
implementation(libs.compose.multiplatform.material3)
4647
implementation(libs.compose.multiplatform.ui)
4748
implementation(libs.compose.multiplatform.foundation)

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4
125125
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version = "1.11.0-rc01" }
126126

127127
# Compose Multiplatform
128+
compose-multiplatform-animation = { module = "org.jetbrains.compose.animation:animation", version.ref = "compose-multiplatform" }
128129
compose-multiplatform-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose-multiplatform" }
129130
compose-multiplatform-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose-multiplatform" }
130131
compose-multiplatform-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "compose-multiplatform" }

0 commit comments

Comments
 (0)