1.4 KiB
1.4 KiB
Fix Gradle Configuration Mutation Error
The project is encountering a Cannot mutate the dependencies of configuration after the configuration was resolved error. This is primarily caused by a mismatch between the Android Gradle Plugin (AGP) version (8.2.2) and the Gradle version (9.3.0). AGP 8.2.2 is not fully compatible with the stricter configuration resolution rules in Gradle 9.x.
Proposed Changes
Build Configuration
[MODIFY] build.gradle.kts (root)
- Upgrade AGP to
9.3.1to match the Gradle version. - Upgrade Kotlin to
2.0.0for better compatibility with newer AGP and Gradle versions.
[MODIFY] app/build.gradle.kts
- Explicitly disable
dataBindingto ensure it doesn't trigger unnecessary configuration resolution, while keepingviewBindingenabled. - Update
kotlinOptionsandjvmTargetif necessary (though 1.8 is usually fine, newer AGP might prefer 17).
[MODIFY] gradle.properties
- Disable Jetifier if not needed, as it can interfere with configuration resolution in newer Gradle versions.
Verification Plan
Automated Tests
- Run
./gradlew assembleDebugto verify the build succeeds without the configuration mutation error.