Skip to content

ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Instance of 'NotInitializedError' #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
iamevaristus opened this issue Jan 15, 2023 · 1 comment

Comments

@iamevaristus
Copy link

E/flutter (13752): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Instance of 'NotInitializedError'
E/flutter (13752): #0 DotEnv.env
package:flutter_dotenv/src/dotenv.dart:42
E/flutter (13752): #1 DotEnv.maybeGet
package:flutter_dotenv/src/dotenv.dart:58
E/flutter (13752): #2 DotEnv.get
package:flutter_dotenv/src/dotenv.dart:53
E/flutter (13752): #3 new ApiKeystore
package:user/.env/api_keystore.dart:23
E/flutter (13752): #4 main
package:user/main.dart:18
E/flutter (13752):
E/flutter (13752):

@larskuerten
Copy link

larskuerten commented Sep 6, 2023

Probably you forgot (happened to me) to include the code below in the main.dart file :

Future main() async {
  // To load the .env file contents into dotenv.
  // NOTE: fileName defaults to .env and can be omitted in this case.
  // Ensure that the filename corresponds to the path in step 1 and 2.
  await dotenv.load(fileName: ".env");
  //...runapp
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants