Gradle Doctor
This skill makes you an expert at resolving Gradle dependency conflicts, build failures, and configuration errors.
Instructions
- If an APK build fails (e.g.
flutter build apk), capture the exact error output. - If the error is a dependency resolution failure (like "Could not resolve all files for configuration ':app:debugRuntimeClasspath'"):
a. Check
android/build.gradleforminSdkVersionandcompileSdkVersion. b. Use your web search tool to find the exact Maven package version needed. c. Adjust the versions inpubspec.yamlorandroid/app/build.gradle. - If the error mentions missing SDKs or NDKs, run
flutter doctor -vand check the Android toolchain status. - For persistent cache issues, you can recommend or run
cd android && ./gradlew clean.
When to use
- The Flutter build fails during the Gradle assembly phase.
- There are AndroidX migration or compatibility errors.
- You encounter dependency version mismatch errors between plugins.