无法在 IOS 上使用 firestore 运行 flutter 项目

Unable to run flutter project on IOS with firestore

我无法在 IOS 模拟器上 运行 flutter 项目。我已将 Cloud Firestore for Firebase 与该项目集成。该项目 运行 在 Android 设备上完美运行,但无法 运行 在 IOS 模拟器上运行。

如果有人能帮我解决这个问题,我将不胜感激。

当我 运行 pod install 命令时出现以下错误请检查。

Muhammads-MacBook-Pro:ios bhatti$ pod install Analyzing dependencies [!] CDN: trunk Repo update failed - 44 error(s): CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.2.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.2.1/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.3.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.3.1/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.4.2/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.4.3/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.4.4/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.5.1/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.6.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.7.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.8.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/3.9.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/4.0.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/4.0.1/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/4.0.2/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/4.0.3/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/4.0.4/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/4.0.5/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/4.0.9/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/4.1.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/4.2.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.0.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.0.1/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.1.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.1.1/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.1.2/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.1.4/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.2.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.3.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.4.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.5.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.6.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.7.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.8.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/5.8.1/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/6.0.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/6.0.1/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/6.0.2/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/6.0.3/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/6.0.4/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/6.1.0/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/6.1.1/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/6.1.2/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known) CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/e/2/1/FirebaseAnalytics/6.1.3/FirebaseAnalytics.podspec.json,
error: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: nodename nor servname provided, or not known)

错误

*** First throw call stack:
(
 0   CoreFoundation                      0x00007fff23baa1ee __exceptionPreprocess + 350
 1   libobjc.A.dylib                     0x00007fff50864b20 objc_exception_throw + 48
 2   CoreFoundation                      0x00007fff23baa02c +[NSException raise:format:] + 188
 3   Runner                              0x0000000103e82d7a +[FIRApp configure] + 138
 4   Runner                              0x0000000104397086 -[FLTCloudFirestorePlugin init] + 214
 5   Runner                              0x0000000104396f11 +[FLTCloudFirestorePlugin registerWithRegistrar:] + 289
 6   Runner                              0x0000000103e7e5c0 +[GeneratedPluginRegistrant registerWithRegistry:] + 112
 7   Runner                        <…>

Error connecting to the service protocol: HttpException: , uri = http://127.0.0.1:62281/vg54TtZ_CH0=/ws

AppDelegate

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GeneratedPluginRegistrant registerWithRegistry:self];
  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

@end

可能有很多原因。请提供错误或错误消息的屏幕截图。

我最近添加了 cloud_firestore 并花了几天时间来解决 ios 的依赖项问题。

一些常见的错误是:

  1. 版本兼容性 Firestore 至少需要 XCode version 10.1
  2. Pod 文件未安装。 解决这个问题从终端转到 yourproject/ios 目录和 运行 以下命令

pod install

  1. 确保你执行了这个Step

如果您可以提供更多信息或您执行的步骤,我可以进一步指导您。