(解消済)[Flutter]「speech_to_text」パッケージをFlutter3で使うとビルドエラーが発生します(動画なし)

このページには広告が含まれる場合があります。

 

(注)本件は2022/5/15にバージョン5.5.0へのアップグレードで解消された模様です。

日本時間の2022/5/12未明に、FlutterSDKの安定版が3.0にアップグレードされましたが、

Flutterで音声認識できるパッケージである「speech_to_text」をFlutter3.0にアップグレードしたプロジェクトでお使いの場合は、以下のようなビルドエラーが発生します。

e: /opt/homebrew/Caskroom/flutter/2.10.4/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-5.4.3/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt: (81, 8): Class 'SpeechToTextPlugin' 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: /opt/homebrew/Caskroom/flutter/2.10.4/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-5.4.3/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt: (627, 5): 'onRequestPermissionsResult' overrides nothing
e: /opt/homebrew/Caskroom/flutter/2.10.4/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-5.4.3/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt: (771, 9): Class 'ChannelResultWrapper' is not abstract and does not implement abstract member public abstract fun error(p0: String, p1: String?, p2: Any?): Unit defined in io.flutter.plugin.common.MethodChannel.Result
e: /opt/homebrew/Caskroom/flutter/2.10.4/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-5.4.3/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt: (786, 5): 'error' overrides nothing
e: /opt/homebrew/Caskroom/flutter/2.10.4/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-5.4.3/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt: (789, 30): Type mismatch: inferred type is String? but String was expected

FAILURE: Build failed with an exception.

パッケージのサイトでissueは上がっているのですが、まだ解決されていないので、「speech_to_text」をお使いの場合は現時点ではFlutter3にアップグレードしないで下さい。

Flutter3にアップグレードしてしまった場合は、現時点ではターミナルから「flutter downgrade」して、バージョンを2.10.xにダウングレードした方が無難です。

こんな記事も読まれています

今すぐ無料お試しキットを受け取る

はじめての方へ


みんプロ式プログラミング講座体系・ラインナップ
みんプロ式プログラミング講座受講の流れ(割引特典利用方法)
サイトマップ(みんプロHPコンテンツ一覧)
運営会社概要

みんプロ作成アプリ





TOP