Flutter build errors when adding app_settings to pubspec.yaml in pristine project

68 views Asked by At

Created a new project with flutter: flutter create testje Then add "app_settings: ^5.1.1" to dependencies of pubspec.yaml. Then flutter clean flutter build apk --target-platform android-arm64 this yields: ......

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules jetified-kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and jetified-kotlin-stdlib-jdk8-1.7.10 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10)
     Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations found in modules jetified-kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and jetified-kotlin-stdlib-jdk7-1.7.10 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10)

This is a fairly pristine debian/stable install with android-studio Giraffe and Hedgehog. Android 13 and 14. Flutter 3.16.2. No jdk/jre installed apart from the one that comes with android-studio.

This the most simple version of the problem that I can create. What is wrong here? How can I solve it?

After ONLY adding a dependency to the new flutter project, that is not needed anyway, I did not expect errors. I have a project with a number of problems that I try to solve by creating such simple examples.

0

There are 0 answers