Modify Kotlin version on AAR produced from a Flutter module

42 Views Asked by At

I'm building a Flutter module which is meant to combine some new Flutter code to be integrated into our legacy native Android project. The problem is that flutter build aar always using an old Kotlin version 1.7.10, hence the build fails since version 1.9.0 is required.

The only way to proceed is modifying the build.gradle on the generated .android folder manually with my desired changes, and building again.

This change will be lost once i rebuild the module, as expected.

How can this be solved? How can one control a Flutter module build.gradle when its being overwritten?

Relevant Flutter doctor output:

[✓] Flutter (Channel stable, 3.16.8, on macOS 12.6 21G115 darwin-arm64, locale en-IL) • Flutter version 3.16.8 on channel stable at /Users/alonshahaf/develop/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 67457e669f (12 days ago), 2024-01-16 16:22:29 -0800 • Engine revision 6e2ea58a5c • Dart version 3.2.5 • DevTools version 2.28.5

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/alonshahaf/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted.

0

There are 0 best solutions below