Skip to content

FormatException (FormatException: Invalid UTF-8 byte (at offset 0)) #83

Open

Description

@poka-IT

This line work working before upgrading to Flutter 3.7:

await dotenv.load();

But now, this is generating this error:

FormatException (FormatException: Invalid UTF-8 byte (at offset 0))

the content of my .env file:

ip_address=tata


full stack trace:

E/flutter ( 7336): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Invalid UTF-8 byte (at offset 0)
E/flutter ( 7336): #0      _Utf8Decoder.convertSingle (dart:convert-patch/convert_patch.dart:1747:7)
E/flutter ( 7336): #1      Utf8Decoder.convert (dart:convert/utf.dart:351:42)
E/flutter ( 7336): #2      Utf8Codec.decode (dart:convert/utf.dart:63:20)
E/flutter ( 7336): #3      AssetBundle.loadString
asset_bundle.dart:87
E/flutter ( 7336): <asynchronous suspension>

Activity

  1. kwadwo-ntiamoah commented on Mar 13, 2023

    @kwadwo-ntiamoah

    Facing this issue too

  2. kelvinTechbiz commented on Feb 21, 2025

    @kelvinTechbiz

    is this fixed?

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions