kineapps / flutter_archive

Flutter plugin for creating and extracting ZIP files.
https://pub.dev/packages/flutter_archive
BSD 3-Clause "New" or "Revised" License
59 stars 44 forks source link

Unhandled Exception: FormatException: Unexpected extension byte (at offset 21) #56

Closed renehw closed 2 years ago

renehw commented 2 years ago

I'm getting an error decoding the buffer, my zip file is encoded in ANSI. How fix?

final inputStream = InputFileStream(item.path!);
final archive = ZipDecoder().decodeBuffer(inputStream);
E/flutter (27669): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FormatException: Unexpected extension byte (at offset 21)
E/flutter (27669): #0      _Utf8Decoder.convertSingle (dart:convert-patch/convert_patch.dart:1789:7)
E/flutter (27669): #1      Utf8Decoder.convert (dart:convert/utf.dart:351:42)
E/flutter (27669): #2      InputFileStream.readString
package:archive/…/io/input_file_stream.dart:355
E/flutter (27669): #3      new ZipFileHeader
package:archive/…/zip/zip_file_header.dart:45
E/flutter (27669): #4      new ZipDirectory.read
package:archive/…/zip/zip_directory.dart:53
E/flutter (27669): #5      ZipDecoder.decodeBuffer
[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [versão 10.0.19044.1706], locale pt-BR)
    • Flutter version 2.10.5 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (4 weeks ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at C:\Users\Rene-Bsoft\AppData\Local\Android\Sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • ANDROID_HOME = C:\Users\Rene-Bsoft\.android\.android\avd
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-b60-7590822)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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 11.0.11+9-b60-7590822)

[√] VS Code (version 1.67.2)
    • VS Code at C:\Users\Rene-Bsoft\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.40.0

[√] Connected device (4 available)
    • sdk gphone x86 64 arm64 (mobile) • emulator-5554 • android-x64    • Android 11 (API 30) (emulator)
    • Windows (desktop)                • windows       • windows-x64    • Microsoft Windows [versão 10.0.19044.1706]
    • Chrome (web)                     • chrome        • web-javascript • Google Chrome 101.0.4951.67
    • Edge (web)                       • edge          • web-javascript • Microsoft Edge 101.0.1210.47

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
kinex commented 2 years ago

Seems to be related to a different plugin https://github.com/brendan-duncan/archive