1
2

More than 3 years have passed since last update.

【Flutter】エラー対応 assets_audio_player

Last updated at Posted at 2021-02-07

エラー内容

下記Gitでイシューに上がっていますが、根本的な解決策はまだ挙がってなさそうです。
https://github.com/florent37/Flutter-AssetsAudioPlayer/issues/399

e: /Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-2.0.13+1/android/src/main/kotlin/com/github/florent37/assets_audio_player/Player.kt: (542, 5): 'handleMessage' overrides nothing
e: /Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-2.0.13+1/android/src/main/kotlin/com/github/florent37/assets_audio_player/Player.kt: (543, 29): Type mismatch: inferred type is Message? but Message was expected
e: /Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-2.0.13+1/android/src/main/kotlin/com/github/florent37/assets_audio_player/notification/NotificationActionReceiver.kt: (12, 85): Type mismatch: inferred type is String? but String was expected
e: /Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-2.0.13+1/android/src/main/kotlin/com/github/florent37/assets_audio_player/notification/NotificationActionReceiver.kt: (30, 39): Type mismatch: inferred type is Intent? but Intent was expected

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':assets_audio_player: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 37s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin assets_audio_player...
Running Gradle task 'assembleAarRelease'...


FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':compileReleaseAidl'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/yo4hi6o/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-2.0.13+1/android/local.properties'.

* 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 0s

Exception: The plugin assets_audio_player could not be built due to the issue above.


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

解決方法

buildgradle4.1.0→4.0.1 へダウングレード

android/build.gradle
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'//ここを4.0.1に変更
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }

イシューでは他で問題が発生するなど議題になっていますが、私の場合、
現時点でのFirebase最新版のパッケージと互換しております。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2