appsup-dart / firebase_dart

A pure Dart implementation of the Firebase client
Other
91 stars 30 forks source link

Windows app stucked on release mode #18

Closed thegrxp closed 2 years ago

thegrxp commented 2 years ago

Hello,

Everything work fine on debug mode, but when I build my app on release mode with the command "flutter build windows" and then run the .exe on the same computer, the app is stucked on a white screen. It doesn't happen when I comment this line:

await Firebase.initializeApp(
    options: FirebaseOptions.fromMap(json
        .decode(File('example/firebase-config.json').readAsStringSync())));

I found a Stackoverflow issue with a similar problem: https://stackoverflow.com/a/69221938

The reason for not finding that in release mode can be one of the following,

You are using some dll (package that depends on a dll) that is available on a specific path in your system, but when you are release the app that (absolute) path is not valid anymore.

Thank you for you help and for this amazing package!

rbellens commented 2 years ago

I haven't tested it on windows yet and also don't have access to a windows device to test it on. As this package is written in pure dart, an issue with a dll seems unlikely to me. Possibly, there is an issue with another resource that is not found (although I don't know which one it could be).

Are you sure, the example/firebase-config.json file is found and can be read?

thegrxp commented 2 years ago

The json file can be found and read when I run the app in debug from the IDE so I don't think that's the issue

thegrxp commented 2 years ago

The json file can be found and read when I run the app in debug from the IDE so I don't think that's the issue

I was wrong, if I directly use the content of the json file as a String it is working. For some reason it can't read this file from the assets folder but it can get .json files used for translations and images.

Thank you for your time