flutter_dotenv icon indicating copy to clipboard operation
flutter_dotenv copied to clipboard

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

Open poka-IT opened this issue 3 years ago • 2 comments

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>

poka-IT avatar Mar 10 '23 15:03 poka-IT

Facing this issue too

kwadwo-ntiamoah avatar Mar 13 '23 12:03 kwadwo-ntiamoah