如何修复 "This operation is not supported in the environment this application is running on. "location.protocol" ..." 错误 运行 Xcode?

How to fix "This operation is not supported in the environment this application is running on. "location.protocol" ..." error running Xcode?

我正尝试通过 Xcode 运行 带有 iPhone 模拟器的离子电容器应用程序。 它在过去几周内运行良好。 运行使用本地主机(ionic serve)连接应用程序仍然可以正常工作。

但是,从昨天开始,当我在模拟器上或通过 Xcode 直接在 iPhone 上 运行 时出现以下错误:

[error] - ERROR {"code":"auth/operation-not-supported-in-this-environment","message":"This operation is not supported in the environment this application is running on. \"location.protocol\" must be http, https or chrome-extension and web storage must be enabled."}

对于身份验证,我只使用 Firebase 电子邮件和密码身份验证。没有 Facebook 或 Google 授权。

我已经尝试使用 post 中建议的其他 Firebase 库。 但这并没有帮助。

有人知道如何解决这个问题吗?

毕竟我发现这个 solution 现在解决了这个问题:

将@angular/fire 从 6.0.3 降级到 6.0.2

  1. npm install @angular/fire@6.0.2
  2. 删除文件夹node_modules:rm -rf node_modules
  3. npm i