尝试在 Flutter 项目上运行 Firebase 时缺少 PDB 文件 [LNK4099、LNK2019、LNK2001]

PDB file missing when trying to run Firebase on a Flutter project [LNK4099, LNK2019, LNK2001]

提问人:Ielin Daisy Devashania 提问时间:5/22/2023 更新时间:6/30/2023 访问量:1106

问:

尝试在 Flutter 项目上运行 Firebase 时找不到 PDB 文件。

我正在尝试在 VS Code 上运行 Flutter 应用程序。我设置了 Firebase,将 google-services.json 文件添加到我的根文件夹中,并安装了以下依赖项:cloud_firestore、firebase_auth、firebase_core 和 firebase_storage。

但是,我在调试时收到以下错误: firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_app_desktop.obj):警告LNK4099:在“firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_app_desktop.obj)”或“C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\Debug\firebase_app.pdb”中找不到 PDB“firebase_app.pdb”;链接对象,好像没有调试信息 [C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\firebase_core_plugin.vcxproj]

firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_log.obj):警告LNK4099:在“firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_log.obj)”或“C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\Debug\firebase_app.pdb”中找不到 PDB“firebase_app.pdb”;链接对象,好像没有调试信息 [C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\firebase_core_plugin.vcxproj]

firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_app_options.obj):警告LNK4099:在“firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_app_options.obj)”或“C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\Debug\firebase_app.pdb”中找不到 PDB“firebase_app.pdb”;链接对象,好像没有调试信息 [C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\firebase_core_plugin.vcxproj]

firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_app_common.obj):警告LNK4099:在“firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_app_common.obj)”或“C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\Debug\firebase_app.pdb”中找不到 PDB“firebase_app.pdb”;链接对象,好像没有调试信息 [C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\firebase_core_plugin.vcxproj]

firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_mutex_windows.obj) : 警告 LNK4099:在“firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_mutex_windows.obj)”或“C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\Debug\firebase_app.pdb”中找不到 PDB“firebase_app.pdb”;链接对象,好像没有调试信息 [C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\firebase_core_plugin.vcxproj]

firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_date_provider.obj) : 警告 LNK4099: PDB' 'firebase_app.pdb' 未找到 'firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_date_provider.obj)' 或 'C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\Debug\firebase_app.pdb';链接对象,好像没有调试信息 [C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\firebase_core_plugin.vcxproj]

firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_heartbeat_controller_desktop.obj) : warning LNK4099: PDB 'firebase_app.pdb' was not found with 'firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_heartbeat_controller_desktop.obj)' or at 'C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\Debug\firebase_app.pdb'; linking object as if no debug info [C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\firebase_core_plugin.vcxproj]

firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_log_stdio.obj) : warning LNK4099: PDB 'firebase_app.pdb' was not found with 'firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_log_stdio.obj)' or at 'C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\Debug\firebase_app.pdb'; linking object as if no debug info [C:\Users\Asus\Desktop\instagram_flutter\build\windows\plugins\firebase_core\firebase_core_plugin.vcxproj]

and errors LNK2019, LNK2001. I don't have any pdb file saved.

Could someone please guide me as to how to get around this error? Thank you. Any help would be greatly appreciated.

flutter firebase flutter-dependencies lnk2001

评论

1赞 ouzari 11/15/2023
Please, did you find a solution for this problem?

答:

0赞 starlocke 6/30/2023 #1

I just experienced the same issue myself.

You're most likely missing "Desktop Development with C++" with your Visual Studio installation.

Additional pointers:

  • It's likely best to have only one of or installed. There's not much point in duplicating the toolset on a development workstation. I opted to uninstall .Visual StudioVisual Studio Build ToolsVisual Studio Build Tools

  • If you do have installed alongside Visual Studio, then don't mix-and-match different years of and - ex: 2019 + 2022. Use the same editions, like 2022 + 2022.Visual Studio Build ToolsVisual StudioVisual Studio Build Tools