sst*_*off 6 ios firebase flutter
Flutter 2.8.1 使用 flutterfire - 根据文档,不需要使用 GoogleService-Info.plist 文件。该版本声明它支持直接 dart 初始化。在模拟器上工作正常,但是当在真实的 iOS 设备上运行时 - 从 Android Studio 或 XCode,我收到有关 plist 文件的错误。flutterfire configure 创建一个有效的 firebase_options.dart 文件,main 如下所示:
\nvoid main() async {\n WidgetsFlutterBinding.ensureInitialized();\n await Firebase.initializeApp(\n options: DefaultFirebaseOptions.currentPlatform,\n );\n\n runApp(const MyApp());\n}\nRun Code Online (Sandbox Code Playgroud)\nflutter doctor 的输出:
\nDoctor summary (to see all details, run flutter doctor -v):\n[\xe2\x9c\x93] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-x64, locale en-US)\n[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)\n \xe2\x9c\x97 cmdline-tools component is missing\n Run `path/to/sdkmanager --install "cmdline-tools;latest"`\n See https://developer.android.com/studio/command-line for more details.\n \xe2\x9c\x97 Android license status unknown.\n Run `flutter doctor --android-licenses` to accept the SDK licenses.\n See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.\n[\xe2\x9c\x93] Xcode - develop for iOS and macOS (Xcode 13.2.1)\n[\xe2\x9c\x93] Chrome - develop for the web\n[\xe2\x9c\x93] Android Studio (version 2020.3)\n[\xe2\x9c\x93] VS Code (version 1.63.2)\n[\xe2\x9c\x93] Connected device (3 available)\nRun Code Online (Sandbox Code Playgroud)\n
小智 0
您是否已在 XCode 中添加 GoogleServices-info.plist 文件?
我的意思是你是否将它从 Finder 拖放到 Android Studio 或 XCode 中。
您需要将其拖放到 XCode 中。
| 归档时间: |
|
| 查看次数: |
2263 次 |
| 最近记录: |