无法使用Firestore在IOS上运行Flutter项目

时间:2019-10-23 10:01:26

标签: ios flutter flutter-dependencies

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

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

运行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

1 个答案:

答案 0 :(得分:0)

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

我最近添加了cloud_firestore,并且花了几天的时间才解决了ios的依赖性问题。

一些常见的错误是:

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

pod install

  1. 确保您执行了此Step

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