在华为手机中选择文件时应用程序崩溃 - Flutter

问题描述 投票:0回答:1

我使用 Flutter 编写了一个应用程序,并添加了用于上传文件的包,如下所示,该应用程序在除华为手机之外的其他手机上正常运行,在上传文件时应用程序崩溃,我看到下面的问题

Flutter HWUI Binary is  disabled 

  image_cropper: ^5.0.1
  image_picker: ^1.0.4 

  pickImageFromGallery() async {
    final selectedFile = await picker.pickImage(source: ImageSource.gallery);

    if (selectedFile != null) {
      CroppedFile? croppedFile = await ImageCropper().cropImage(
        sourcePath: selectedFile.path,
        aspectRatioPresets: [
          CropAspectRatioPreset.square,
          CropAspectRatioPreset.ratio3x2,
          CropAspectRatioPreset.original,
          CropAspectRatioPreset.ratio4x3,
          CropAspectRatioPreset.ratio16x9
        ],
        uiSettings: [
          AndroidUiSettings(
              toolbarTitle: 'Cropper',
              toolbarColor: Colors.deepOrange,
              toolbarWidgetColor: Colors.white,
              initAspectRatio: CropAspectRatioPreset.original,
              lockAspectRatio: false),
          IOSUiSettings(
            title: 'Cropper',
          ),
          WebUiSettings(
            context: context,
          ),
        ],
      );

      if (croppedFile != null) {
        setState(() {
          imagePath = croppedFile.path;
        });
      }
    }
  }

Flutter HWUI 二进制已禁用

flutter dart huawei-mobile-services huawei-developers
1个回答
0
投票

目前....

Firebase 和 Firestore SDK 需要 Google Play 服务,因为新的华为手机被禁止使用 GMS。您必须使用其他替代方案来替代这些需要 Google Pay 服务的功能。

https://medium.com/@eamankyim/unraveling-the-mystery-why-huawei-phones-dont-support-firebase-and-its-impact-on-user-experience-72be2504ac75

您可以使用以下 statckoweflow 答案来解决这些问题。

© www.soinside.com 2019 - 2024. All rights reserved.