Skip to content

Migrate Android implementation (rive_native) to Built-in Kotlin (AGP 9.0+ compatibility) #649

Description

@BlindingTree

Submission checklist

  • I have confirmed the issue is present in the latest version of the rive Flutter package
  • I have searched the documentation and forums and could not find an answer
  • I have searched existing issues and this is not a duplicate

Description

I am using rive_native (via rive package) in my Flutter app and have encountered an issue with its Android build configuration.

Problem

The Android implementation (rive_native) applies the Kotlin Gradle Plugin (KGP) using apply plugin: "kotlin-android" in its build.gradle. Starting with AGP 9.0, this approach is deprecated and will cause build failures in future Flutter versions.

Current Issue

  • Uses apply plugin: "kotlin-android" in the Android module
  • Uses kotlinOptions (old syntax) instead of kotlin.compilerOptions (new syntax)

Required Changes in rive_native:

  1. Remove apply plugin: "kotlin-android"
  2. Replace kotlinOptions block with:
kotlin {
    compilerOptions {
        jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
    }
}

References
Flutter migration guide for plugin authors: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors

Flutter issue #189133: https://github.com/flutter/flutter/issues/189133

Workaround
I'm keeping android.builtInKotlin=false in gradle.properties temporarily until this is resolved.

Please migrate the Android implementation to Built-in Kotlin to ensure your users can build their apps in future Flutter versions.

Thank you!

### Reproduction steps / code

The issue occurs during Android build when using `rive_native` as a dependency via the `rive` package.

### Upload your reproduction files / stack trace

_No response_

### Source `.riv` / `.rev` file

_No response_

### Screenshots / video

_No response_

### Rive Flutter package version

0.14.10

### Flutter version

Flutter 3.44.4 • channel [user-branch] • unknown source
Framework • revision 1234567890 (some hash)
Engine • revision 1234567890
Tools • Dart 3.9.0

### Device

Infinix X6731B (Android device)

### OS version

Android 14 (API level 34)

### Additional context

The warning appears when running `flutter run` on Android. Keeping `android.builtInKotlin=false` in gradle.properties as a temporary workaround.
P.s. created and work with DeepSeek

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions