Open hnexokonkwo opened 4 years ago
Can you confirm the .env file is included in the bundle? Typically you will add the .env file with the desired environment config as part of the build.
same thing seems to happen with flutter build web. the .env file is present in build/web/assets/.env But as per the docs, .env should be declared in ./ in pubspec.yaml:
assets:
- .env
not sure if its the problem though
same issue. I also tried to add the env file into the assets directory.
I've got the same issue
This is happening to me too unfortunately. Everything goes fine when I run in debug mode, but when I run the web build release then the error happens!
I notice that I had a unrelated bug. I just added the file into the assets directory and include the file in the pubspec.yaml. Worked
i tried dropping .env in /assets, no luck.
Attempted to deploy web build version on surge, the provided example with .env file in assets folder works fine: web version. Ensure that - the .env
file location, - the fileName parameter in dotenv.load() and - asset filepath in pubspec.yaml, are all the same.
During the release for iOS, the app I work on was crashing on startup on a physical device with iOS 14.6 (it was working just fine on the simulator). The application was already in production for Android.
I removed all code related to the package before iOS release build and the app did not crash anymore. Seems like the .env
file was not being created.
NOTE: I was getting the variables using env['VARIABLE_NAME']
within the code.
removed the dot from the start of file name resolve for me. from ".env" to "env"
removed the dot from the start of file name resolve for me. from ".env" to "env"
This should be included in documentation. The documentation and the default parameter both suggest to name the file .env but the naming causes issue in flutter web
Using the above suggestion does not resolve issue of the package not working on release mode for iOS or Android.
I have it working while running in dev and profile, but it doesnt work in release mode.
same issue, works fine on debug. On android release it does not work at all.
Seems working on the last version 5.0.2
with Flutter 3.0.1
Check if you have added
<uses-permission android:name="android.permission.INTERNET" />
in your Androidmanifest.xml
Check if you have added
<uses-permission android:name="android.permission.INTERNET" />
in your Androidmanifest.xml
It was cause for me...
removed the dot from the start of file name resolve for me. from ".env" to "env"
It worked ! Thanks a lot!
removed the dot from the start of file name resolve for me. from ".env" to "env"
I had a similar issue building a Flutter module. It work fine for iOS, but it was not working for Android. This solved the issue.
thank you so much! this saved my life.
removed the dot from the start of file name resolve for me. from ".env" to "env"
This solve my issue. Some systems treat files that start with a "dot" in a special way. This is the case with github actions, for example.
How can I use this library to build releases for android and ios? the environment variable does not seem to work after building apk release version