【问题标题】:Target of URI doesn't exist: 'firebase_options.dart'. Try creating the file referenced by the URI, or Try using a URI for a file that does existURI 的目标不存在:\'firebase_options.dart\'。尝试创建由 URI 引用的文件,或尝试对确实存在的文件使用 URI
【发布时间】:2023-01-28 12:04:45
【问题描述】:

请问我该如何解决这个问题 URI 的目标不存在:'firebase_options.dart'。 尝试创建由 URI 引用的文件,或尝试对确实存在的文件使用 URI

  • 我试试这个 flutter clean
  • flutter pub 获取
  • 重启

【问题讨论】:

标签: flutter google-cloud-firestore


【解决方案1】:

通常,firebase_options.dart文件是通过flutterfire configure命令生成的。

仔细检查您是否使用 Flutterfire CLI 正确生成了该文件,并确保您使用正确的路径将其导入您的main.dart(或需要它的文件)

【讨论】:

  • 我之前在我的电脑上安装过带有 CLl 的 firebase,没有错误。但这次我不明白为什么我会出错
  • 当我查看 firebase 控制台并看到该项目仅为 android 创建时,我并不关心 ios。这是一个错误。这就是为什么我不能导入它。FirebaseCommandException:尝试运行命令时 Firebase CLI 发生错误。命令:firebase 应用程序:创建 ios udemy_firebase (ios) --bundle-id=com.example.udemy_firebase --json --project=udemy-firebase-c5ece 错误:无法为项目 udemy-firebase-c5ece 创建 iOS 应用程序。有关详细信息,请参阅 firebase-debug.log。
  • 那么,firebase 的 debug.log 中的错误是什么?
【解决方案2】:

运行flutter pub add firebase_core 这可能是因为你还没有在项目中安装 firecore

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-03
    • 2021-07-04
    • 1970-01-01
    • 1970-01-01
    • 2021-04-03
    • 2021-06-12
    • 2018-12-23
    • 2019-01-19
    相关资源
    最近更新 更多