fluttercommunity / plus_plugins

Flutter Community Plus Plugins
BSD 3-Clause "New" or "Revised" License
1.55k stars 936 forks source link

[build]: flutter build web crashed because of this . #3139

Open wangqiwei66 opened 1 month ago

wangqiwei66 commented 1 month ago

Platform

web

Plugin

share_plus

Version

10.0.0 or 9.0.0

Flutter SDK

3.3.0

Steps to reproduce

flutter build web

Code Sample

Target dart2js failed: ProcessException: Process exited abnormally with exit code 253:
../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart:255:20:
Internal Error: Unknown external method j:method(ShareData|constructor#text)
  external factory ShareData.text({
                   ^
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (3.3.0), and

* the entire message you see here (including the full stack trace
  below as well as the source location above).

Logs

Target dart2js failed: ProcessException: Process exited abnormally with exit code 253:
../../.pub-cache/hosted/pub.dev/share_plus-9.0.0/lib/src/share_plus_web.dart:255:20:
Internal Error: Unknown external method j:method(ShareData|constructor#text)
  external factory ShareData.text({
                   ^
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (3.3.0), and

* the entire message you see here (including the full stack trace
  below as well as the source location above).

The compiler crashed: Assertion failure: Unknown external method j:method(ShareData|constructor#text)
#0      failedAt (package:compiler/src/diagnostics/invariant.dart:39:3)
#1      KernelSsaGraphBuilder._buildExternalFunctionNode (package:compiler/src/ssa/builder.dart:1825:5)
#2      KernelSsaGraphBuilder.build.<anonymous closure> (package:compiler/src/ssa/builder.dart:439:15)
#3      DiagnosticReporter.withCurrentElement (package:compiler/src/diagnostics/diagnostic_listener.dart:154:15)
#4      KernelSsaGraphBuilder.build (package:compiler/src/ssa/builder.dart:427:21)
#5      KernelSsaBuilder.build.<anonymous closure> (package:compiler/src/js_model/js_strategy.dart:525:22)
#6      CompilerTask.measure (package:compiler/src/common/tasks.dart:66:51)
#7      KernelSsaBuilder.build (package:compiler/src/js_model/js_strategy.dart:507:18)
#8      SsaBuilderTask.build (package:compiler/src/ssa/ssa.dart:365:21)
#9      SsaFunctionCompiler.compile (package:compiler/src/ssa/ssa.dart:99:28)
#10     OnDemandCodegenResults.getCodegenResults (package:compiler/src/common/codegen.dart:409:30)
#11     JsBackendStrategy.generateCode (package:compiler/src/js_model/js_strategy.dart:331:43)
#12     KernelCodegenWorkItem.run (package:compiler/src/js_model/js_strategy.dart:466:29)
#13     Compiler.emptyQueue.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure>
(package:compiler/src/compiler.dart:752:70)
#14     CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#15     Compiler.emptyQueue.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:compiler/src/compiler.dart:752:32)
#16     CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#17     Compiler.emptyQueue.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:compiler/src/compiler.dart:750:28)
#18     DiagnosticReporter.withCurrentElement (package:compiler/src/diagnostics/diagnostic_listener.dart:154:15)
#19     Compiler.emptyQueue.<anonymous closure>.<anonymous closure> (package:compiler/src/compiler.dart:748:18)
#20     CodegenEnqueuer._forEach (package:compiler/src/js_backend/enqueuer.dart:266:12)
#21     CodegenEnqueuer.forEach (package:compiler/src/js_backend/enqueuer.dart:282:5)
#22     Compiler.emptyQueue.<anonymous closure> (package:compiler/src/compiler.dart:744:16)
#23     CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#24     Compiler.emptyQueue (package:compiler/src/compiler.dart:743:14)
#25     Compiler.processQueue.<anonymous closure> (package:compiler/src/compiler.dart:767:7)
#26     CompilerTask.measureSubtask (package:compiler/src/common/tasks.dart:181:35)
#27     Compiler.processQueue (package:compiler/src/compiler.dart:761:14)
#28     Compiler.runCodegenEnqueuer (package:compiler/src/compiler.dart:472:5)
#29     Compiler.runSequentialPhases (package:compiler/src/compiler.dart:680:27)
<asynchronous suspension>
#30     Compiler.runInternal.<anonymous closure> (package:compiler/src/compiler.dart:315:7)
<asynchronous suspension>
#31     Compiler.runInternal (package:compiler/src/compiler.dart:314:5)
<asynchronous suspension>
#32     Compiler.run.<anonymous closure> (package:compiler/src/compiler.dart:235:11)
<asynchronous suspension>
#33     compile.<anonymous closure> (package:compiler/compiler_api.dart:256:30)
<asynchronous suspension>
#34     compile.compilationDone (package:compiler/src/dart2js.dart:729:3)
<asynchronous suspension>
#35     main (package:compiler/src/dart2js.dart:1233:3)
<asynchronous suspension>
  Command: /Users/wangqiwei/development/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev
  /Users/wangqiwei/development/flutter/bin/cache/dart-sdk/bin/snapshots/dart2js.dart.snapshot
  --platform-binaries=/Users/wangqiwei/development/flutter/bin/cache/flutter_web_sdk/kernel --invoker=flutter_tool -Ddart.vm.product=true -DFLUTTER_WEB_AUTO_DETECT=true
  -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/04817c99c9fd4956f27505204f7e344335810aed/ --native-null-assertions --no-source-maps -O4 -o
  /Users/wangqiwei/Program/openhealthhk_mobileapp/.dart_tool/flutter_build/846120b4c5c0513ff1e25f1352e8304a/main.dart.js
  /Users/wangqiwei/Program/openhealthhk_mobileapp/.dart_tool/flutter_build/846120b4c5c0513ff1e25f1352e8304a/app.dill
#0      RunResult.throwException (package:flutter_tools/src/base/process.dart:127:5)
#1      _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:326:19)
<asynchronous suspension>
#2      Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:192:5)
<asynchronous suspension>
#3      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:861:9)
<asynchronous suspension>
#4      Future.wait.<anonymous closure> (dart:async/future.dart:518:21)
<asynchronous suspension>
#5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:799:32)
<asynchronous suspension>
#6      Future.wait.<anonymous closure> (dart:async/future.dart:518:21)
<asynchronous suspension>
#7      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:799:32)
<asynchronous suspension>
#8      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:628:16)
<asynchronous suspension>
#9      WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:93:34)
<asynchronous suspension>
#10     BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:200:5)
<asynchronous suspension>
#11     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1389:27)
<asynchronous suspension>
#12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#13     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#14     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:355:9)
<asynchronous suspension>
#15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#16     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:295:5)
<asynchronous suspension>
#17     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:119:9)
<asynchronous suspension>
#18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#19     main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>

Compiling lib/main.dart for the Web...                             29.3s
Error: Failed to compile application for the Web.

Flutter Doctor

Flutter (Channel stable, 3.19.1, on macOS 14.5 23F79 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.19.1 on channel stable at /Users/wangqiwei/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision abb292a07e (5 months ago), 2024-02-20 14:35:05 -0800
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1
    • Pub download mirror https://pub.dev
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/wangqiwei/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_SDK_ROOT = /Users/wangqiwei/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.13.0

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

[✓] Android Studio (version 2024.1)
    • 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.10+0-17.0.10b1087.21-11609105)

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

[✓] Connected device (4 available)
    • Andrew's 14PM (mobile) • 00008120-001C3CD1369B401E • ios            • iOS 17.6 21G80
    • Wang ipad air (mobile) • 00008103-001359380A30C01E • ios            • iOS 17.5.1 21F90
    • macOS (desktop)        • macos                     • darwin-arm64   • macOS 14.5 23F79 darwin-arm64
    • Chrome (web)           • chrome                    • web-javascript • Google Chrome 127.0.6533.89
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as
      this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for Andrew's 14P. Ensure the device is unlocked and attached with a cable or associated with the same local area network
      as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for 漆桂芳的iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network
      as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

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

• No issues found!

Checklist before submitting a bug

miquelbeltran commented 1 month ago

FYI share_plus will be moved to web 1.0.0 when this PR is ready: https://github.com/fluttercommunity/plus_plugins/pull/3105 that would probably fix the error you have.