Skip to content

Fix APK build: self-contained Kotlin-DSL Gradle project#2

Merged
BlazeTrack merged 0 commit into
mainfrom
devin/1782171954-fix-gradle-project
Jun 26, 2026
Merged

Fix APK build: self-contained Kotlin-DSL Gradle project#2
BlazeTrack merged 0 commit into
mainfrom
devin/1782171954-fix-gradle-project

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

CI failed with Your app is using an unsupported Gradle project. Root cause: the repo committed legacy Groovy Gradle files (build.gradle, settings.gradle, wrapper 8.x), while the CI step flutter create . --platforms=android regenerated modern Kotlin-DSL files (AGP 9.x / Gradle 9.x) on top of them — producing an inconsistent, half-migrated Android project on every run.

This PR makes the Android project self-contained and deterministic so flutter build apk --release --no-pub succeeds without flutter create:

  • Replace Groovy Gradle files with committed Kotlin DSL equivalents (settings.gradle.kts, build.gradle.kts, app/build.gradle.kts) consistent with Gradle 9.1.0 + AGP, and update gradle-wrapper.properties to match.
  • Stop committing the wrapper jar / gradlew (now gitignored); flutter build regenerates them, verified in a clean checkout.
  • Drop the fragile flutter create . step from .github/workflows/build_apk.yml; CI now just runs flutter pub get then builds.
- - name: 4. Generar o actualizar el proyecto Android
-   run: |
-     flutter create . --platforms=android --org com.example
-     flutter pub get
+ - name: 4. Obtener dependencias del proyecto
+   run: |
+     flutter pub get

Additional fixes required for the build to compile:

  • app/build.gradle.kts: add implementation("com.google.android.material:material:1.12.0")Theme.EclipseShell extends Theme.MaterialComponents.*, which otherwise fails Android resource linking.
  • AndroidManifest.xml: remove the deprecated package attribute (rejected by AGP 8+; namespace comes from Gradle).
  • lib/audio/audio_handler.dart: remove a duplicate _defaultScanRoot() declaration and add the missing toggleShuffle() method called from eclipse_shell_app.dart.

Also added a pull_request trigger to the workflow so the APK build is validated on PRs (not only on push to main), guarding against future regressions.

Verification

  • Built from a fresh clone of this branch (no wrapper jar / gradlew present, no flutter create):
flutter pub get
flutter build apk --release --no-pub
✓ Built build/app/outputs/flutter-apk/app-release.apk (51.9MB)
  • GitHub Actions build check passes on this PR.

Link to Devin session: https://app.devin.ai/sessions/397387253e524159baa36ad526240957
Requested by: @BlazeTrack

@BlazeTrack BlazeTrack self-assigned this Jun 22, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant