I started with flutter last week and I got this problem with the audioplayer package. I am doing a Flutter Development Bootcamp with Dart at Udemy. I followed almost everything at the video, but I recived a huge error message that I can't solve.
This is my code:
import 'package:flutter/material.dart';
import 'package:audioplayers/audioplayers.dart';
void main() => runApp(XylophoneApp());
class XylophoneApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.lightBlue,
body: SafeArea(
child: Container(
child: Center(
child: TextButton(
onPressed: (){
final player = AudioCache();
player.play('assets/note1');
},
child: Text(
'click me'
),
),
),
),
),
),
);
}
}
This is the error message that i get: Running Gradle task 'assembleDebug'... e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors e: C:/Users/victo/.gradle/caches/transforms-2/files-2.1/24fa3aa8d2270e5eb067bbe36e9b7563/jetified-kotlin-stdlib-1.5.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15... (The message is much more larger than this)
- What went wrong: Execution failed for task ':audioplayers:compileDebugKotlin'.
Compilation error. See log for more details
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 21s Exception: Gradle task assembleDebug failed with exit code 1
I've seen this message The binary version of its metadata is 1.5.1, expected version is 1.1.15, but I dont know what to do with it or how I can solve it.
This is my pubspec.yaml:
name: xylophone
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
audioplayers: ^0.19.1
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- assets/