无法构建关于Flutter的Awesome通知V0.7.3

xpszyzbs  于 2022-12-30  发布在  Flutter
关注(0)|答案(1)|浏览(260)

我在flutter项目中添加了awesome notifications包,并在main.dart文件中初始化了它,但当我尝试构建应用程序时,收到了以下错误:'

Launching lib\main.dart on Android SDK built for x86 in debug mode...
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.3/lib/src/utils/resource_image_provider.dart:40:26: Error: Type 'DecoderBufferCallback' not found.
      ResourceImage key, DecoderBufferCallback decode) {
                         ^^^^^^^^^^^^^^^^^^^^^
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.3/lib/src/utils/resource_image_provider.dart:48:26: Error: Type 'DecoderBufferCallback' not found.
      ResourceImage key, DecoderBufferCallback decode) async {
                         ^^^^^^^^^^^^^^^^^^^^^
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.3/lib/awesome_notifications_method_channel.dart:186:10: Error: Type 'Uint8List' not found.
  Future<Uint8List?> getDrawableData(String drawablePath) async {
         ^^^^^^^^^
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.3/lib/src/utils/resource_image_provider.dart:21:7: Error: The non-abstract class 'ResourceImage' is missing implementations for these members:
 - ImageProvider.load
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.
class ResourceImage extends ImageProvider<ResourceImage> {
      ^^^^^^^^^^^^^
/E:/flutter/packages/flutter/lib/src/painting/image_provider.dart:584:24: Context: 'ImageProvider.load' is defined here.
  ImageStreamCompleter load(T key, DecoderCallback decode);
                       ^^^^
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.3/lib/src/utils/resource_image_provider.dart:40:26: Error: 'DecoderBufferCallback' isn't a type.
      ResourceImage key, DecoderBufferCallback decode) {
                         ^^^^^^^^^^^^^^^^^^^^^
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.3/lib/src/utils/resource_image_provider.dart:48:26: Error: 'DecoderBufferCallback' isn't a type.
      ResourceImage key, DecoderBufferCallback decode) async {
                         ^^^^^^^^^^^^^^^^^^^^^
/E:/flutter/.pub-cache/hosted/pub.dartlang.org/awesome_notifications-0.7.3/lib/src/utils/resource_image_provider.dart:50:5: Error: 'Uint8List' isn't a type.
    Uint8List? bytes =

    ^^^^^^^^^

FAILURE: Build failed with an exception.

* Where:
Script 'E:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'E:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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 1m 8s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

'
我多次尝试重新安装软件包,但没有任何变化

vmdwslir

vmdwslir1#

您需要更新flutter版本:
第一个月
或者将awesome_notifications降级到旧版本。
https://pub.dev/packages/awesome_notifications#common-known-issues
问题:未找到解码器缓冲区回调/Uint 8列表
修正:你需要更新你的Flutter版本来运行flutter升级。这些方法是在2.12版本中添加/弃用的。

相关问题