Skip to content

flutter build ios - Crash - [tool_crash] FormatException : Missing extension byte (at offset 17) #81666

Open

Description

@eminovperviz

Command

flutter build ios

Steps to Reproduce

  1. ...
  2. ...
  3. ...

Logs

FormatException

#0      _Utf8Decoder.convertChunked (dart:convert-patch/convert_patch.dart:1892:7)
#1      _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:314:28)
#2      _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
#3      _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#4      _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#5      _rootRunUnary (dart:async/zone.dart:1436:47)
#6      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#7      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#9      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#10     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#11     _StreamController._add (dart:async/stream_controller.dart:607:7)
#12     _StreamController.add (dart:async/stream_controller.dart:554:5)
#13     _Socket._onData (dart:io-patch/socket_patch.dart:2160:41)
#14     _rootRunUnary (dart:async/zone.dart:1444:13)
#15     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#16     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#17     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#18     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#19     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
#20     _StreamController._add (dart:async/stream_controller.dart:607:7)
#21     _StreamController.add (dart:async/stream_controller.dart:554:5)
#22     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1696:33)
#23     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1208:14)
#24     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
[✓] Flutter (Channel master, 2.3.0-1.0.pre.205, on macOS 11.1 20C69 darwin-x64, locale en)
    • Flutter version 2.3.0-1.0.pre.205 at /Users/bestcomp/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 96e4b47f5d (17 hours ago), 2021-05-02 07:24:01 -0700
    • Engine revision 3e578c6e0d
    • Dart version 2.14.0 (build 2.14.0-48.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/bestcomp/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

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

[✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.40.2)
    • VS Code at /Users/bestcomp/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.8.1

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.93

• No issues found!

Flutter Application Metadata

Type: app
Version: 4.0.1+11
Material: true
Android X: false
Module: false
Plugin: false
Android package: null
iOS bundle identifier: null
Creation channel: stable
Creation framework version: 8874f21

Plugins

connectivity-2.0.2
connectivity_for_web-0.3.1+4
connectivity_macos-0.1.0+7
file_picker-2.1.7
flutter_full_pdf_viewer-1.0.6
flutter_plugin_android_lifecycle-1.0.11
flutter_secure_storage-3.3.5
image_picker-0.6.7+22
import_js_library-1.0.2
libphonenumber-1.0.2
onesignal_flutter-2.6.3
open_file-3.1.0
path_provider-1.6.28
path_provider_linux-0.0.1+2
path_provider_macos-0.0.4+8
path_provider_windows-0.0.5
permission_handler-5.1.0+2
shared_preferences-0.5.12+4
shared_preferences_linux-0.0.2+4
shared_preferences_macos-0.0.1+11
shared_preferences_web-0.1.2+7
shared_preferences_windows-0.0.2+3
sqflite-2.0.0+3
url_launcher-5.7.10
url_launcher_linux-0.0.1+4
url_launcher_macos-0.0.1+9
url_launcher_web-0.1.5+3
url_launcher_windows-0.0.1+3
video_player-1.0.1
video_player_web-0.1.4+1
wakelock-0.2.1+1
wakelock_web-0.1.0+3
webview_cookie_manager-1.0.8
webview_flutter-1.0.7

Activity

  1. added
    in triagePresently being triaged by the triage team
    a: buildBuilding flutter applications with the tool
    platform-iosiOS applications specifically
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    in triagePresently being triaged by the triage team
    on May 3, 2021
  2. eminovperviz commented on May 3, 2021

    @eminovperviz
    Author

    I solved problem by following steps.

    1. Downgrade Flutter version to Stable v2.0.6
    2. Delete ./pub-cache folder
    3. Repair pub cache - packages
    4. Then build ios
  3. pedromassangocode commented on May 3, 2021

    @pedromassangocode

    Now that this is solved, I'm not sure if this should be closed.
    Cc @jmagman

  4. jmagman commented on May 4, 2021

    @jmagman
    Member

    I'm not sure which package would cause this, let's leave it open.
    See also #65932

  5. jerryzhoujw commented on Jul 30, 2021

    @jerryzhoujw
    Contributor

    After i upgrade to nullable safety with the project.
    I build the project.with flutter build ios --release
    I got error: FormatException: FormatException: Missing extension byte (at offset 29)

    How to find which part causing this error ?

    [+3887 ms] FormatException: Missing extension byte (at offset 29)
    [   +6 ms] "flutter run" took 210,569ms.
    [   +8 ms]
               #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
               #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:663:9)
               <asynchronous suspension>
               #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
               <asynchronous suspension>
               #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
               <asynchronous suspension>
               #4      CommandRunner.runCommand (package:args/command_runner.dart:196:13)
               <asynchronous suspension>
               #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
               <asynchronous suspension>
               #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
               <asynchronous suspension>
               #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
               <asynchronous suspension>
               #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
               <asynchronous suspension>
               #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
               <asynchronous suspension>
               #10     main (package:flutter_tools/executable.dart:91:3)
               <asynchronous suspension>
    
    
    [ +257 ms] ensureAnalyticsSent: 256ms
    [   +3 ms] Running shutdown hooks
    [        ] Shutdown hooks complete
    [        ] exiting with code 1
    
    Flutter crash report

    command

    flutter build ios --release

    exception

    FormatException: FormatException: Missing extension byte (at offset 29)

    #0      _Utf8Decoder.convertChunked (dart:convert-patch/convert_patch.dart:1891:7)
    #1      _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:314:28)
    #2      _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
    #3      _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
    #4      _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
    #5      _rootRunUnary (dart:async/zone.dart:1362:47)
    #6      _CustomZone.runUnary (dart:async/zone.dart:1265:19)
    #7      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
    #8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
    #9      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
    #10     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
    #11     _StreamController._add (dart:async/stream_controller.dart:607:7)
    #12     _StreamController.add (dart:async/stream_controller.dart:554:5)
    #13     _Socket._onData (dart:io-patch/socket_patch.dart:2160:41)
    #14     _rootRunUnary (dart:async/zone.dart:1370:13)
    #15     _CustomZone.runUnary (dart:async/zone.dart:1265:19)
    #16     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
    #17     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
    #18     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
    #19     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
    #20     _StreamController._add (dart:async/stream_controller.dart:607:7)
    #21     _StreamController.add (dart:async/stream_controller.dart:554:5)
    #22     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1696:33)
    #23     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1208:14)
    #24     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
    #25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
    #26     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:120:13)
    #27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)
    

    flutter doctor

    [✓] Flutter (Channel stable, 2.2.3, on macOS 11.5 20G71 darwin-x64, locale en-CN)
        • Flutter version 2.2.3 at /Users/jerryzhou/Documents/code/flutter/sdk/flutter
        • Framework revision f4abaa0735 (4 weeks ago), 2021-07-01 12:46:11 -0700
        • Engine revision 241c87ad80
        • Dart version 2.13.4
        • 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 30.0.0-rc1)
        • Android SDK at /Users/jerryzhou/Library/Android/sdk
        • Platform android-30, build-tools 30.0.0-rc1
        • Java binary at: /Users/jerryzhou/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/192.6392135/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.5.1, Build version 12E507
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 3.6)
        • Android Studio at /Users/jerryzhou/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/192.6392135/Android Studio.app/Contents
        • Flutter plugin version 45.1.1
        • Dart plugin version 192.7761
        • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    
    [✗] Cannot determine if IntelliJ is installed
        ✗ Directory listing failed
    
    [✓] VS Code (version 1.58.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.24.0
    
    [✓] Connected device (1 available)
        • Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.107
    
    ! Doctor found issues in 1 category.
    
  6. jmagman commented on Jul 30, 2021

    @jmagman
    Member

    This is the number 4 crasher on the latest beta, though the absolute number is low. It also shows up from flutter devices.

    @jonahwilliams any idea where this is coming from, or how to improve the stacktrace?

  7. jonahwilliams commented on Jul 30, 2021

    @jonahwilliams
    Contributor

    The general problem is dart-lang/sdk#44994 . There are unfortunately multiple layers where reasonable stacks are dropped.

  8. jerryzhoujw commented on Aug 20, 2021

    @jerryzhoujw
    Contributor

    Actually every time after flutter clean, it's only show error on first build, and if I run flutter build ios --release again, error gone.

  9. pliniocelos commented on Sep 8, 2021

    @pliniocelos

    I've been trying all stuff I found googling, but nothing works.

  10. 8 remaining items

  11. zy1041081552 commented on Dec 28, 2021

    @zy1041081552

    Who can solve this problem, this problem has been bothering me for 2 weeks.

    I solved this problem, #95881 and If your flutter project has a resource file with a non-English name, then you need to add this parameter in the "rsync App.framework" place

    Thank you so much ! ! ! I changed the Chinese in the resource name to English, which solved my problem !

  12. added
    P2Important issues not at the top of the work list
    on Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolc: crashStack traces logged to the consoleplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions