Flutter 构建在 iOS 上失败,但在 android 上工作

Posted

技术标签:

【中文标题】Flutter 构建在 iOS 上失败,但在 android 上工作【英文标题】:Flutter build failed on iOS but works on android 【发布时间】:2019-10-08 04:35:43 【问题描述】:

ios 上构建和运行 Flutter 应用程序失败。它在 android 上工作,但在 iOS 上中断并失败

我正在使用 iphone 8 模拟器。

flutter --version Flutter 1.3.8 • 频道测试版 • https://github.com/flutter/flutter.git 框架 • 修订版 e5b1ed7a7f (3 个月前)• 2019-03-06 14:23:37 -0800 引擎• 修订 f4951df193 工具 • Dart 2.2.1(构建 2.2.1-dev.0.0 571ea80e11)

发布规范 名称:icps 描述:一个新的 Flutter 项目。

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org.
version: 1.0.0+1

environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  curved_navigation_bar: ^0.1.26
  permission_handler: ^2.1.3
  google_maps_flutter: ^0.2.0+6
  page_indicator: ^0.1.3
  flutter_rating: ^0.0.2

  flutter_screenutil: ^0.5.1
  dio: ^2.1.0
  http: ^0.12.0+1
  toast: ^0.1.3
  fluttertoast: ^3.0.3
  date_format: ^1.0.6
  intl: ^0.15.8
  path: ^1.6.2
  file_picker: ^1.3.3
  path_provider: ^0.5.0+1
  downloads_path_provider: ^0.0.2
  open_file: ^2.0.1+2
  fab_menu: ^0.0.2
  font_awesome_flutter: ^8.4.0
  cached_network_image: ^0.8.0

dev_dependencies:
  flutter_test:
    sdk: flutter



My podfile

flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', 
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,


def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path)  |line|
      next if skip_line_start_symbols.any?  |symbol| line =~ /^\s*#symbol/ 
      plugin = line.split(pattern=separator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#path", file_abs_path)
        pods_ary.push(:name => podname, :path => podpath);
      else
        puts "Invalid plugin specification: #line"
      end
  
  return pods_ary
end

target 'Runner' do
  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  # Flutter Pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
  end
  generated_xcode_build_settings.map  |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
    end
  

  # Plugin Pods
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map  |p|
    symlink = File.join('.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
  
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end


Launching lib/main.dart on iPhone 8 Plus in debug mode...
Error: unable to find directory entry in pubspec.yaml: /Users/damilola/icps/assets/images/activity_feed/
Error: unable to find directory entry in pubspec.yaml: /Users/damilola/icps/assets/images/partners/
Removing obsolete reference to flutter_assets from Runner.app
Running pod install...
Running Xcode build...
Xcode build done.                                            4.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    === BUILD TARGET fluttertoast OF PROJECT Pods WITH CONFIGURATION Debug ===
    /Users/damilola/icps/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.m:101:9: warning: 'dispatch_queue_set_specific' is only available on iOS 5.0 or newer [-Wunguarded-availability]
            dispatch_queue_set_specific(_queue, kDispatchQueueSpecificKey, (__bridge void *)self, NULL);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'Foundation' imported from /Users/damilola/icps/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.h:9:
    In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Dispatch' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/dispatch/queue.h:1216:1: note: 'dispatch_queue_set_specific' has been explicitly marked partial here
    dispatch_queue_set_specific(dispatch_queue_t queue, const void *key,
    ^
    /Users/damilola/icps/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.m:101:9: note: enclose 'dispatch_queue_set_specific' in an @available check to silence this warning
            dispatch_queue_set_specific(_queue, kDispatchQueueSpecificKey, (__bridge void *)self, NULL);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/damilola/icps/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.m:184:54: warning: 'dispatch_get_specific' is only available on iOS 5.0 or newer [-Wunguarded-availability]
        FMDatabaseQueue *currentSyncQueue = (__bridge id)dispatch_get_specific(kDispatchQueueSpecificKey);
                                                         ^~~~~~~~~~~~~~~~~~~~~
    In module 'Foundation' imported from /Users/damilola/icps/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.h:9:
    In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
    In module 'Dispatch' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:20:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/dispatch/queue.h:1272:1: note: 'dispatch_get_specific' has been explicitly marked partial here
    dispatch_get_specific(const void *key);
    ^
    /Users/damilola/icps/ios/Pods/FMDB/src/fmdb/FMDatabaseQueue.m:184:54: note: enclose 'dispatch_get_specific' in an @available check to silence this warning
        FMDatabaseQueue *currentSyncQueue = (__bridge id)dispatch_get_specific(kDispatchQueueSpecificKey);
                                                         ^~~~~~~~~~~~~~~~~~~~~
    2 warnings generated.
    === BUILD TARGET fluttertoast OF PROJECT Pods WITH CONFIGURATION Debug ===
    /Users/damilola/icps/ios/Pods/FMDB/src/fmdb/FMDatabase.m:1486:15: warning: 'sqlite3_wal_checkpoint_v2' is only available on iOS 5.0 or newer [-Wunguarded-availability]
        int err = sqlite3_wal_checkpoint_v2(_db, dbName, checkpointMode, logFrameCount, checkpointCount);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'SQLite3' imported from /Users/damilola/icps/ios/Pods/FMDB/src/fmdb/FMDatabase.m:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/sqlite3.h:8015:16: note: 'sqlite3_wal_checkpoint_v2' has been explicitly marked partial here
    SQLITE_API int sqlite3_wal_checkpoint_v2(
                   ^
    /Users/damilola/icps/ios/Pods/FMDB/src/fmdb/FMDatabase.m:1486:15: note: enclose 'sqlite3_wal_checkpoint_v2' in an @available check to silence this warning
        int err = sqlite3_wal_checkpoint_v2(_db, dbName, checkpointMode, logFrameCount, checkpointCount);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
    In file included from /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.m:5:
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:11:51: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)setCameraTargetBounds:(GMSCoordinateBounds*)bounds;
                                                      ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:11:51: note: insert '_Nullable' if the pointer may be null
    - (void)setCameraTargetBounds:(GMSCoordinateBounds*)bounds;
                                                      ^
                                                       _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:11:51: note: insert '_Nonnull' if the pointer should never be null
    - (void)setCameraTargetBounds:(GMSCoordinateBounds*)bounds;
                                                      ^
                                                       _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:29:64: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
                        registrar:(NSObject<FlutterPluginRegistrar>*)registrar;
                                                                   ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:29:64: note: insert '_Nullable' if the pointer may be null
                        registrar:(NSObject<FlutterPluginRegistrar>*)registrar;
                                                                   ^
                                                                    _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:29:64: note: insert '_Nonnull' if the pointer should never be null
                        registrar:(NSObject<FlutterPluginRegistrar>*)registrar;
                                                                   ^
                                                                    _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:32:49: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)animateWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                    ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:32:49: note: insert '_Nullable' if the pointer may be null
    - (void)animateWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                    ^
                                                     _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:32:49: note: insert '_Nonnull' if the pointer should never be null
    - (void)animateWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                    ^
                                                     _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:33:46: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)moveWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                 ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:33:46: note: insert '_Nullable' if the pointer may be null
    - (void)moveWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                 ^
                                                  _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:33:46: note: insert '_Nonnull' if the pointer should never be null
    - (void)moveWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                 ^
                                                  _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:34:21: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (GMSCameraPosition*)cameraPosition;
                        ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:34:21: note: insert '_Nullable' if the pointer may be null
    - (GMSCameraPosition*)cameraPosition;
                        ^
                         _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:34:21: note: insert '_Nonnull' if the pointer should never be null
    - (GMSCameraPosition*)cameraPosition;
                        ^
                         _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:35:12: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (NSString*)addMarkerWithPosition:(CLLocationCoordinate2D)position;
               ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:35:12: note: insert '_Nullable' if the pointer may be null
    - (NSString*)addMarkerWithPosition:(CLLocationCoordinate2D)position;
               ^
                _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:36:56: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (FLTGoogleMapMarkerController*)markerWithId:(NSString*)markerId;
                                                           ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:36:56: note: insert '_Nullable' if the pointer may be null
    - (FLTGoogleMapMarkerController*)markerWithId:(NSString*)markerId;
                                                           ^
                                                            _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:36:56: note: insert '_Nonnull' if the pointer should never be null
    - (FLTGoogleMapMarkerController*)markerWithId:(NSString*)markerId;
                                                           ^
                                                            _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:37:37: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)removeMarkerWithId:(NSString*)markerId;
                                        ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:37:37: note: insert '_Nullable' if the pointer may be null
    - (void)removeMarkerWithId:(NSString*)markerId;
                                        ^
                                         _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:37:37: note: insert '_Nonnull' if the pointer should never be null
    - (void)removeMarkerWithId:(NSString*)markerId;
                                        ^
                                         _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:42:4: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar;
       ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:42:4: note: insert '_Nullable' if the pointer may be null
    - (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar;
       ^
                    _Nullable 
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:42:4: note: insert '_Nonnull' if the pointer should never be null
    - (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar;
       ^
                    _Nonnull 
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:42:68: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar;
                                                                       ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:42:68: note: insert '_Nullable' if the pointer may be null
    - (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar;
                                                                       ^
                                                                        _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:42:68: note: insert '_Nonnull' if the pointer should never be null
    - (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar;
                                                                       ^
                                                                        _Nonnull
    11 warnings generated.
    In file included from /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapsPlugin.m:5:
    In file included from /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapsPlugin.h:7:
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:11:51: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)setCameraTargetBounds:(GMSCoordinateBounds*)bounds;
                                                      ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:11:51: note: insert '_Nullable' if the pointer may be null
    - (void)setCameraTargetBounds:(GMSCoordinateBounds*)bounds;
                                                      ^
                                                       _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:11:51: note: insert '_Nonnull' if the pointer should never be null
    - (void)setCameraTargetBounds:(GMSCoordinateBounds*)bounds;
                                                      ^
                                                       _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:29:64: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
                        registrar:(NSObject<FlutterPluginRegistrar>*)registrar;
                                                                   ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:29:64: note: insert '_Nullable' if the pointer may be null
                        registrar:(NSObject<FlutterPluginRegistrar>*)registrar;
                                                                   ^
                                                                    _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:29:64: note: insert '_Nonnull' if the pointer should never be null
                        registrar:(NSObject<FlutterPluginRegistrar>*)registrar;
                                                                   ^
                                                                    _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:32:49: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)animateWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                    ^
Could not build the application for the simulator.
    - (void)animateWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
Error launching application on iPhone 8 Plus.
                                                    ^
                                                     _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:32:49: note: insert '_Nonnull' if the pointer should never be null
    - (void)animateWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                    ^
                                                     _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:33:46: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)moveWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                 ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:33:46: note: insert '_Nullable' if the pointer may be null
    - (void)moveWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                 ^
                                                  _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:33:46: note: insert '_Nonnull' if the pointer should never be null
    - (void)moveWithCameraUpdate:(GMSCameraUpdate*)cameraUpdate;
                                                 ^
                                                  _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:34:21: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (GMSCameraPosition*)cameraPosition;
                        ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:34:21: note: insert '_Nullable' if the pointer may be null
    - (GMSCameraPosition*)cameraPosition;
                        ^
                         _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:34:21: note: insert '_Nonnull' if the pointer should never be null
    - (GMSCameraPosition*)cameraPosition;
                        ^
                         _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:35:12: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (NSString*)addMarkerWithPosition:(CLLocationCoordinate2D)position;
               ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:35:12: note: insert '_Nullable' if the pointer may be null
    - (NSString*)addMarkerWithPosition:(CLLocationCoordinate2D)position;
               ^
                _Nullable
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:35:12: note: insert '_Nonnull' if the pointer should never be null
    - (NSString*)addMarkerWithPosition:(CLLocationCoordinate2D)position;
               ^
                _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:36:32: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (FLTGoogleMapMarkerController*)markerWithId:(NSString*)markerId;
                                   ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:36:56: note: insert '_Nonnull' if the pointer should never be null
    - (FLTGoogleMapMarkerController*)markerWithId:(NSString*)markerId;
                                                           ^
                                                            _Nonnull
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.2.0+6/ios/Classes/GoogleMapController.h:37:37: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    - (void)removeMarkerWithId:(NSString*)markerId;
                                        ^
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/permission_handler-2.2.0/ios/Classes/PermissionManager.swift:57:45: error: type 'UIApplication' has no member 'openSettingsURLString'
                    guard let url = URL(string: UIApplication.openSettingsURLString),
                                                ^~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/permission_handler-2.2.0/ios/Classes/PermissionManager.swift:63:45: error: type 'UIApplication' has no member 'OpenExternalURLOptionsKey'
                    let optionsKeyDictionary = [UIApplication.OpenExternalURLOptionsKey(rawValue: "universalLinksOnly"): NSNumber(value: true)]
                                                ^~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/damilola/.pub-cache/hosted/pub.dartlang.org/permission_handler-2.2.0/ios/Classes/PermissionManager.swift:68:77: error: type 'UIApplication' has no member 'openSettingsURLString'
                    let success = UIApplication.shared.openURL(URL.init(string: UIApplication.openSettingsURLString)!)
                                                                                ^~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~

【问题讨论】:

您的部署目标/支持的最低 iOS 版本是多少? 部署目标是iOS 8 5个月后,你解决了吗?我有同样的问题,但我得到的错误是:[!] 无法找到 FMDB (~&gt; 2.7.2) 的规范,这取决于 sqflite 【参考方案1】:

选项 1: 在Podfile中,将target增加到9并删除Podfile.lock并运行(flutter build IOS)

选项 2: 如果不起作用,请尝试更改 Podfile:

target 'Runner' do
# Flutter Pod
use_frameworks!
use_modular_headers!

然后: 扑干净 删除 Podfile.lock 吊舱安装--repo-update pod 更新 FBSDKLoginKit

打开 .xcworkspace 并在 General-> Deployment Info 中设置 Target 11.0 也在 Podfile 中设置 Target 11.0

【讨论】:

以上是关于Flutter 构建在 iOS 上失败,但在 android 上工作的主要内容,如果未能解决你的问题,请参考以下文章

断言在 Web 版本上失败,但在 iOS Flutter 上成功

在 iOS 模拟器上运行 Flutter 失败,但在 Android 模拟器上可能

在 BigSur、XCode 12 上 Flutter iOS 构建失败

由于线程构建失败,Flutter 在 iOS 上崩溃

Flutter:iOS 构建失败

在 Xcode 上构建失败,但在 run-ios 上成功