Flutter build fails due to Audio Wave forms package

Viewed 70

Im trying to build my app, but it keeps failing, with error:

Class 'AudioRecorder' is not abstract and does not implement abstract member public abstract fun onRequestPermissionsResult(p0: Int, p1: Array<(out) String!>, p2: IntArray): Boolean defined in io.flutter.plugin.common.PluginRegistry.RequestPermissionsResultListener
e: /Users/baw/flutter/.pub-cache/hosted/pub.dartlang.org/audio_waveforms-0.1.1/android/src/main/kotlin/com/simform/audio_waveforms/AudioRecorder.kt: (97, 5): 'onRequestPermissionsResult' overrides nothing

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':audio_waveforms:compileDebugKotlin'.
> Compilation error. See log for more details

BUILD FAILED in 1m 53s
Exception: Gradle task assembleDebug failed with exit code 1

Ive tried removing and re-adding the package, flutter clean and none of it all seems to work.

I just upgraded to flutter version 3.0.2 Below is my flutter doctor output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.3.1 21E258 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.68.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!

Please help.

1 Answers

According to the package's developer, this can be fixed temporarily, through a hotfix he created on the package repo.

Replace the package import in the pubspec.yaml with a git import as shown below. Replace

audio_waveforms: ^0.1.1

with

audio_waveforms:
    git:
      url: https://github.com/SimformSolutionsPvtLtd/audio_waveforms.git
      ref: hotfix/flutter_version3.0.0

That should fix the issue for now, as we await a new release of the package.

Related