Search code examples
fluttergoogle-cloud-firestorefirebase-authenticationfirebase-storageflutter-windows

LNK2001 error when trying to build a flutter application for windows


Recently the firebase official packages including (Firebase_Auth, cloud_Firestore, and Firebase_storage), started supporting windows platform. Prior to that I was using community packages for the connection with firebase services but since the support was finally here I decided to switch my windows app to start using the official packages and here started the issue. Whenevr I try to build a flutter for windows app that contains any one of the mentioned packages I would get a "LNK2001" error.

: error LNK2001: unresolved external symbol __imp__CrtDbgReport

error LNK2001: unresolved external symbol __imp__calloc_dbg

error LNK2001: unresolved external symbol __imp__invalid_parameter

I have been searching all over the internet for a while and could not get my hand on a working solution. I would highly appreciate any help in this matter.


Solution

  • A bug was reported for this and fixed a couple of days ago. See this link for more information. https://github.com/firebase/flutterfire/pull/11997

    If you update firebase_core to the latest version (I also updated firebase_auth and cloud_firestore as well in my app) this should resolve the issue