Skip to content

[Proposal]Incorrect kotlin-stdlib-jdk7 is added as a dependency for newly generated projects on Android #101373

@wujek-srujek

Description

@wujek-srujek
$ flutter --version
Flutter 2.10.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision c860cba910 (12 days ago) • 2022-03-25 00:23:12 -0500
Engine • revision 57d3bac3dd
Tools • Dart 2.16.2 • DevTools 2.9.2

When a new project is created with flutter create ... the org.jetbrains.kotlin:kotlin-stdlib-jdk7 dependency is added by default in android/app/build.gradle but it is not strictly correct: as the project by default targets Java 8 it should use the kotlin-stdlib-jdk8 artifact id.

However, it could be best to just remove this dependency altogether because it is added by default by the Kotlin Gradle plugin (https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library) - always the correct one and always in the correct version (corresponding to the Kotlin Gradle plugin version). This way any future updates of the artifact id (e.g. when stdlib-jdk11 or whatever comes along and Flutter wants to use it) nothing will need to be done except update the Kotlin plugin version and the target Java version.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Flutterplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versiont: 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