-1

I have been doing Flutter for only 2 weeks. I love it. Everything has been going well. Until now.

I need an app I am building to play a few short sounds on certain events. This package seemed the way to go:

https://pub.dev/packages/audioplayers

It looks so simple to play a sound, and the package gets a 99% popularity. BUT!

I can't even get the thing to build. I get a bunch of different build errors when I try to use it, even with a dead simple demo app. A bunch of stuff like:

"Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors"

and

"Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15."

This stuff is way over my head. Until yesterday everything "just worked." I have used at least 4 other packages seamlessly. I am frustrated and need help.

Can anyone throw an old dog a bone? :)

1 Answers1

1

In your project folder in android/build.gradle change

ext.kotlin_version = '1.3.50'

to

ext.kotlin_version = '1.4.32'
Ramin
  • 757
  • 1
  • 7
  • Thanks. It didn't work. I still got a wall of errors. The last one was different now, though: **[!] Your project requires a newer version of the Kotlin Gradle plugin. Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update C:\Users\[myname]\Desktop\flutter_dev\__2022\audio\play_01\android\build.gradle: ext.kotlin_version = ''** – mattgflutter7 Jan 04 '22 at 20:33
  • @mattgflutter7 What is your flutter version? This seems to be the error you get if you're on 2.9.0 which is not yet on stable channel: https://docs.flutter.dev/release/breaking-changes/kotlin-version. If that's the case use `1.5.31` instead of `1.4.32` according to documentation. – Ramin Jan 05 '22 at 05:49