OpenFlutter / tobias

AliPay For Flutter.支付宝Flutter插件
Apache License 2.0
696 stars 116 forks source link

web plugin registrant 路径配置错误 #151

Closed dotwoo closed 11 months ago

dotwoo commented 11 months ago

在执行flutter build web 出现下面错误:

Target dart2js failed: ProcessException: Process exited abnormally:
.dart_tool/flutter_build/6f24657ef115e99153646171ae02e05d/web_plugin_registrant.dart:21:8:
Error: Error when reading '../../../.pub-cache/hosted/pub.flutter-io.cn/tobias-3.2.1/lib/tobias_web.dart': Error reading
'../../../.pub-cache/hosted/pub.flutter-io.cn/tobias-3.2.1/lib/tobias_web.dart'  (No such file or directory)
import 'package:tobias/tobias_web.dart';
       ^
.dart_tool/flutter_build/6f24657ef115e99153646171ae02e05d/web_plugin_registrant.dart:39:3:
Error: Undefined name 'TobiasWeb'.
  TobiasWeb.registerWith(registrar);
  ^^^^^^^^^

版本:
tobias: ^3.2.1 [✓] Flutter (Channel stable, 3.16.4, on macOS 14.1.2 23B92 darwin-arm64, locale zh-Hans-CN) • Flutter version 3.16.4 on channel stable at /opt/homebrew/Caskroom/flutter/3.10.5/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2e9cb0aa71 (4 days ago), 2023-12-11 14:35:13 -0700 • Engine revision 54a7145303 • Dart version 3.2.3 • DevTools version 2.28.4 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn

发现 TobiasWeb 定义在 lib/src/tobias_web.dart 文件中 项目的pubspec.yaml 定义不一致:

  plugin:
    platforms:
      android:
        package: com.jarvan.tobias
        pluginClass: TobiasPlugin
      ios:
        pluginClass: TobiasPlugin
      web:
        pluginClass: TobiasWeb
        fileName: tobias_web.dart
JarvanMo commented 11 months ago

不支持web,等我给删除了吧