java-james / flutter_dotenv

Loads environment variables from `.env`.
https://pub.dartlang.org/packages/flutter_dotenv
MIT License
209 stars 46 forks source link

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

Open poka-IT opened 1 year ago

poka-IT commented 1 year ago

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>
kwadwo-ntiamoah commented 1 year ago

Facing this issue too