我的 Flutter 项目没有在 iOS 模拟器中打开

时间:2021-02-26 14:14:48

标签: xcode firebase flutter firebase-cloud-messaging

当我在 Xcode iOS Simulator 中尝试从 android studio 打开 flutter 项目时

颤振输出: 2021-02-26 16:53:42.961 xcodebuild[3871:51012] 警告:“Firebase.debug.xcconfig”的文件引用是多个组(“支持文件”和“支持文件”)的成员;这表明一个畸形的项目。只会保留其中一个组中的成员资格(但目标中的成员资格不受影响)。如果您想在多个组中引用同一个文件,请添加另一个对同一路径的引用。 2021-02-26 16:53:42.961 xcodebuild[3871:51012] 警告:“Firebase.release.xcconfig”的文件引用是多个组(“支持文件”和“支持文件”)的成员;这表明一个畸形的项目。只会保留其中一个组中的成员资格(但目标中的成员资格不受影响)。如果您想在多个组中引用同一个文件,请添加另一个对同一路径的引用。 2021-02-26 16:53:42.969 xcodebuild[3871:51012] 警告:“GoogleUtilities.debug.xcconfig”的文件引用是多个组(“支持文件”和“支持文件”)的成员;这表明一个畸形的项目。只会保留其中一个组中的成员资格(但目标中的成员资格不受影响)。如果您想在多个组中引用同一个文件,请添加另一个对同一路径的引用。 2021-02-26 16:53:42.969 xcodebuild[3871:51012] 警告:“GoogleUtilities.release.xcconfig”的文件引用是多个组(“支持文件”和“支持文件”)的成员;这表明一个畸形的项目。只会保留其中一个组中的成员资格(但目标中的成员资格不受影响)。如果您想在多个组中引用同一个文件,请添加另一个对同一路径的引用。 ** 构建失败 **

Xcode's output:
 ↳
/Users/raghad/StudioProjects/GP_Last_Edition/ios/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m:22:9: fatal error: 'GoogleUtilities/GULAppEnvironmentUtil.h' file not found
#import <GoogleUtilities/GULAppEnvironmentUtil.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/Users/raghad/StudioProjects/GP_Last_Edition/ios/Pods/FirebaseCore/FirebaseCore/Sources/FIRLogger.m:17:9: fatal error: 'GoogleUtilities/GULAppEnvironmentUtil.h' file not found
#import <GoogleUtilities/GULAppEnvironmentUtil.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/Users/raghad/StudioProjects/GP_Last_Edition/ios/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatInfo.m:16:9: fatal error: 'GoogleUtilities/GULHeartbeatDateStorage.h' file not found
#import <GoogleUtilities/GULHeartbeatDateStorage.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/Users/raghad/StudioProjects/GP_Last_Edition/ios/Pods/FirebaseCore/FirebaseCore/Sources/FIRFirebaseUserAgent.m:19:9: fatal error: 'GoogleUtilities/GULAppEnvironmentUtil.h' file not found
#import <GoogleUtilities/GULAppEnvironmentUtil.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'leveldb-library' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Toast' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'fluttertoast' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flutter' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'GoogleIPhoneUtilities' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'GoogleInterchangeUtilities' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'GoogleSymbolUtilities' from project 'Pods')
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'firebase_messaging' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'FirebaseInstanceID' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'FirebaseAnalytics' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'FirebaseMessaging' from project 'Pods')

Could not build the application for the simulator.
Error launching application on iPhone 11.

我在此网站中找到了解决方案 https://github.com/flutter/flutter/issues/66730

但是当我尝试在 Xcode 中打开我的项目时,它显示了我

无法打开文件。 (/Users/raghad/StudioProjects/GP_Last_Edition)

扑医生

[✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.1 20D75 darwin-x64, locale en-SA)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)

[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[✓] Android Studio (version 4.1)
[✓] Connected device (1 available)

• No issues found!

pubspec.yaml

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
   flutter:
   sdk: flutter
  

   cupertino_icons: ^0.1.3
   carousel_pro: ^1.0.0
   http: ^0.12.2
   firebase_core: "^0.7.0"
   firebase_auth: "^0.20.0+1"
   firebase_database: "^6.0.0"
   fluttertoast: ^7.1.6
   firebase_messaging:





   # The following adds the Cupertino Icons font to your application.
 # Use with the CupertinoIcons class for iOS style icons.


dev_dependencies:
   flutter_test:
      sdk: flutter
   #integration_test:
   #   sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
  flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
  uses-material-design: true

# To add assets to your appl

1 个答案:

答案 0 :(得分:0)

正如错误所说:

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99.

您需要在 podfile.lock 中更改构建应用的 iOS 版本(介于 9.0 和 14.4.99 之间)。

在 podfile 中,您将更改参数 platformconfig.build_settings['IPHONEOS_DEPLOYMENT_TARGET](如果有)

在此之后,您应该在 Xcode(Runner 选项卡)中更改版本,清理并再次构建..