Flutter无法构建应用程序的发布版本

wdebmtf2  于 2023-01-06  发布在  Flutter
关注(0)|答案(2)|浏览(203)

flutter run可以工作,但flutter run --releaseflutter run --release --profile返回以下错误:

===== CRASH =====
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x0
version=2.18.6 (stable) (Tue Dec 13 21:15:14 2022 +0000) on "macos_simarm64"
pid=14192, thread=-1, isolate_group=isolate(0x7f910c011200), isolate=(nil)(0x0)
isolate_instructions=0, vm_instructions=0
Stack dump aborted because InitialRegisterCheck failed.
Dart snapshot generator failed with exit code -6

下面是我的pubspec.yaml依赖项:

version: 1.0.0+1
environment:
  sdk: ">=2.15.1 <3.0.0"

dependencies:
  
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  flutter_native_splash: ^2.1.6
  table_calendar: ^3.0.8
  image_stack: ^2.1.1
  intl: ^0.17.0
  shimmer: ^2.0.0
  flutter_riverpod: ^1.0.4
  auto_route: ^5.0.4
  google_fonts: ^3.0.1
  pinput: ^2.2.9
  mask_text_input_formatter: ^2.3.0
  firebase_core: ^1.21.1
  dio: ^4.0.6
  dio_cache_interceptor: ^3.2.7
  dio_cache_interceptor_hive_store: ^3.1.1
  http: ^0.13.5
  enum_to_string: ^2.0.1
  mobile_scanner: ^2.1.0
  firebase_auth: ^3.3.19
  image_picker: ^0.8.5+3
  image_cropper: ^3.0.1
  firebase_storage: ^10.2.18
  fluttertoast: ^8.0.9
  firebase_messaging: ^13.0.1
  hive: ^2.2.1
  hive_flutter: ^1.1.0
  flutter_hooks: ^0.18.5+1
  hooks_riverpod: ^1.0.4
  local_auth: ^2.1.0
  lottie: ^2.1.0
  flutter_local_notifications: ^9.7.0
  device_info_plus: ^4.0.1
  timeago: ^3.2.2
  url_launcher: ^6.1.5
  focused_menu: ^1.0.5
  rxdart: ^0.27.7
  rate_my_app: ^1.1.3
  infinite_scroll_pagination: ^3.2.0
  flutter_offline: ^2.1.0
  webview_flutter: ^4.0.1
  shared_preferences: ^2.0.15
  web_socket_channel: ^2.2.0
  fl_chart: ^0.55.2

dev_dependencies:
  #flutter_gen_runner:
  auto_route_generator: ^5.0.2
  firebase_core_platform_interface: ^4.5.1
  build_runner: any
  flutter_lints: ^2.0.1
  flutter_launcher_icons: ^0.11.0
  flutter_test:
    sdk: flutter
flutter_icons:
    android: "launcher_icon"
    ios: true
    image_path: "assets/icons/b2b_logo.png"

flutter:
  uses-material-design: true
  generate: true
  assets:
    - assets/images/
    - assets/
    - assets/animations/
    - assets/icons/
  fonts:
    - family: SnagIcons
      fonts:
        - asset: assets/fonts/SnagIcons.ttf</summary>

应用程序从2个月前是建设成功,但截至上周,我一直得到这个问题,并恢复的变化,我仍然得到同样的问题。

2ul0zpep

2ul0zpep1#

试着切换到Flutter发展通道并回到Flutter稳定。
做一个扑干净和扑酒吧得到,再试一次。

w41d8nur

w41d8nur2#

发生这种情况是因为packages中的一些更新
尝试在vs code terminal中输入以下代码:

  1. flutter clean
  2. flutter pub get
    你的Flutter代码将像一个魅力!

编辑:

有一些github问题可以解决这个问题,看看是否有适合您的

  1. https://github.com/flutter/flutter/issues/43707
  2. https://github.com/flutter/flutter/issues/109818
  3. https://github.com/flutter/flutter/issues/43597

相关问题