Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

升级到4.2.5web端报错 #549

Closed
JDongKhan opened this issue Jun 20, 2023 · 8 comments
Closed

升级到4.2.5web端报错 #549

JDongKhan opened this issue Jun 20, 2023 · 8 comments

Comments

@JDongKhan
Copy link

Describe the bug

Waiting for connection from debug service on Chrome...
org-dartlang-app:/web_plugin_registrant.dart:13:8: Error: Error when reading '../../../../../.pub-cache/hosted/pub.flutter-io.cn/fluwx-4.2.5/lib/fluwx_web.dart': No such file or directory
import 'package:fluwx/fluwx_web.dart';
       ^
org-dartlang-app:/web_plugin_registrant.dart:27:3: Error: Undefined name 'FluwxWeb'.
  FluwxWeb.registerWith(registrar);
  ^^^^^^^^
Failed to compile application.

/Users/sn/fvm/default/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.0 22A380 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.10.5 on channel stable at /Users/sn/fvm/versions/3.10.5
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (6 days ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/sn/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode_14_2.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] IntelliJ IDEA Community Edition (version 2019.2.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.79.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.66.0

[✓] Connected device (4 available)
    • HEY W09 (mobile)   • A3ALUN2726G10922          • android-arm64  • Android 12 (API 31)
    • sn的iPhone (mobile) • 00008101-001E518E21FA001E • ios            • iOS 16.2 20C65
    • macOS (desktop)    • macos                     • darwin-x64     • macOS 13.0 22A380 darwin-x64
    • Chrome (web)       • chrome                    • web-javascript • Google Chrome 110.0.5481.100

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
Process finished with exit code 0
@JarvanMo
Copy link
Member

等我有时间把web删了。

@JDongKhan
Copy link
Author

那是否能支持在web上面跑? 还是说需要使用者自己适配?

@JDongKhan
Copy link
Author

将yaml里面改成 fileName: src/fluwx_web.dart,就不报错了。

  plugin:
    platforms:
      android:
        package: com.jarvan.fluwx
        pluginClass: FluwxPlugin
      ios:
        pluginClass: FluwxPlugin
      web:
        pluginClass: FluwxWeb
        fileName: src/fluwx_web.dart

@JarvanMo
Copy link
Member

不能。第一个,web 我一窍不通。第二个Web 的套路和Mobile上完全是两个套路

@JarvanMo
Copy link
Member

将yaml里面改成 fileName: src/fluwx_web.dart,就不报错了。

  plugin:
    platforms:
      android:
        package: com.jarvan.fluwx
        pluginClass: FluwxPlugin
      ios:
        pluginClass: FluwxPlugin
      web:
        pluginClass: FluwxWeb
        fileName: src/fluwx_web.dart

之前忽略了web

@JDongKhan
Copy link
Author

我的意思是不需要在web上实现功能,只需要能正常编译通过就行。 不然还得自己去适配import不同的实现。

@JarvanMo
Copy link
Member

我知道,我不说了吗。等我有时间。

@JDongKhan
Copy link
Author

嗯,好的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants