Skip to content

There is a FormatException error when running "flutter build apk" in cmd.exe。Run this "flutter build apk" on PowerShell without this error #15296

Closed

Description

@EvilBT

command

flutter build apk

exception

FormatException: FormatException: Bad UTF-8 encoding 0xbe (at offset 0)

#0      _Utf8Decoder.convert (dart:convert/utf.dart:574)
#1      _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:345)
#2      _Utf8ConversionSink.add (dart:convert/string_conversion.dart:341)
#3      _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:86)
#4      _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120)
#5      _rootRunUnary (dart:async/zone.dart:1134)
#6      _CustomZone.runUnary (dart:async/zone.dart:1031)
#7      _CustomZone.runUnaryGuarded (dart:async/zone.dart:933)
#8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:330)
#9      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:257)
#10     _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:763)
#11     _StreamController._add (dart:async/stream_controller.dart:639)
#12     _StreamController.add (dart:async/stream_controller.dart:585)
#13     _Socket._onData (dart:io-patch/socket_patch.dart:1654)
#14     _rootRunUnary (dart:async/zone.dart:1138)
#15     _CustomZone.runUnary (dart:async/zone.dart:1031)
#16     _CustomZone.runUnaryGuarded (dart:async/zone.dart:933)
#17     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:330)
#18     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:257)
#19     _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:763)
#20     _StreamController._add (dart:async/stream_controller.dart:639)
#21     _StreamController.add (dart:async/stream_controller.dart:585)
#22     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1231)
#23     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:784)
#24     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#26     _runPendingImmediateCallback (dart:isolate-patch/dart:isolate/isolate_patch.dart:113)
#27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:166)

flutter doctor

[✓] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version 10.0.16299.125], locale zh-CN)
    • Flutter version 0.1.5 at H:\google\flutter
    • Framework revision 3ea4d06340 (2 weeks ago), 2018-02-22 11:12:39 -0800
    • Engine revision ead227f118
    • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at H:\android-sdk
    • Android NDK at H:\android-sdk\ndk-bundle
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = H:\android-sdk
    • Java binary at: H:\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[✓] Android Studio (version 3.0)
    • Android Studio at H:\Android Studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2017.2)
    • Flutter plugin version 21.2.2
    • Dart plugin version 172.4343.25

[✓] Connected devices (1 available)
    • MIX 2 • 356a5f19 • android-arm64 • Android 8.0.0 (API 26)

• No issues found!

Run this "flutter build apk" on PowerShell without this error

Activity

  1. added
    platform-windowsBuilding on or for Windows specifically
    c: crashStack traces logged to the console
    on Jun 5, 2018
  2. added this to the milestone on Jun 5, 2018
  3. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Jun 5, 2018
  4. Hixie commented on Jun 5, 2018

    @Hixie
    Contributor

    @EvilBT Does this work with the most recent Flutters? We have done some work on UTF-8 handling since March, though we don't know if it has handled this.

  5. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 5, 2018
  6. EvilBT commented on Jun 10, 2018

    @EvilBT
    Author

    @Hixie It has been fixed in the latest version

  7. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 10, 2018
  8. Hixie commented on Jun 19, 2018

    @Hixie
    Contributor

    Duplicate of #15646

  9. github-actions commented on Aug 15, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Aug 15, 2021
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

    c: crashStack traces logged to the consoleplatform-windowsBuilding on or for Windows specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions