Skip to content

[Android] Kotlin support library dependency no longer required #98212

Closed

Description

@davidmigloz

At the moment, all Flutter Android Kotlin templates contain a dependency on the Kotlin support library. E.g.:

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

Starting from Kotlin 1.4, the Kotlin Gradle plugin adds the dependency on the standard library automatically by default: (ref)

You no longer need to declare a dependency on the stdlib library in any Kotlin Gradle project, including a multiplatform one. The dependency is added by default.

The automatically added standard library will be the same version of the Kotlin Gradle plugin, since they have the same versioning.

For platform-specific source sets, the corresponding platform-specific variant of the library is used, while a common standard library is added to the rest. The Kotlin Gradle plugin will select the appropriate JVM standard library depending on the kotlinOptions.jvmTarget compiler option of your Gradle build script.

The current Kotlin version in the templates is 1.6.10:

const String templateKotlinGradlePluginVersion = '1.6.10';

So the explicit dependency to the Kotlin support library dependency is no longer required.

Activity

  1. changed the title [-]Kotlin support library dependency no longer required[/-] [+][Android] Kotlin support library dependency no longer required[/+] on Feb 10, 2022
  2. added
    in triagePresently being triaged by the triage team
    platform-androidAndroid applications specifically
    c: proposalA detailed proposal for a change to Flutter
    t: gradle"flutter build" and "flutter run" on Android
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Feb 11, 2022
  3. andesappal commented on Feb 15, 2022

    @andesappal
  4. added
    P3Issues that are less important to the Flutter project
    on Jul 12, 2022
  5. added a commit that references this issue on May 5, 2023
    4d4b3cf
  6. github-actions commented on May 19, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterplatform-androidAndroid applications specificallyt: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions