无法在 Xcode 中为 iPhone 4s Simulator 构建 Flutter 应用程序

Posted

技术标签:

【中文标题】无法在 Xcode 中为 iPhone 4s Simulator 构建 Flutter 应用程序【英文标题】:Unable to build a Flutter app for iPhone 4s Simulator in Xcode 【发布时间】:2018-12-22 09:48:17 【问题描述】:

尝试在 X-code 中部署到 iPhone 4s 时出现以下异常。我想用 X-code 构建应用程序,以便解决 Flutter 应用程序在运行 ios 9.3 的 iPhone 4s 设备上崩溃的原因。

Showing Recent Issues

Build target BoringSSL of project Pods with configuration Debug


Build target GTMSessionFetcher of project Pods with configuration Debug


Build target GoogleToolboxForMac of project Pods with configuration Debug


Build target leveldb-library of project Pods with configuration Debug


Build target Protobuf of project Pods with configuration Debug


Build target gRPC-RxLibrary of project Pods with configuration Debug


Build target nanopb of project Pods with configuration Debug


Build target gRPC-gRPCCertificates of project Pods with configuration Debug


Build target path_provider of project Pods with configuration Debug


Build target FirebaseCore of project Pods with configuration Debug


Build target shared_preferences of project Pods with configuration Debug


Build target url_launcher of project Pods with configuration Debug


Build target firebase_core of project Pods with configuration Debug


Build target FirebaseAuth of project Pods with configuration Debug


Build target FirebaseDatabase of project Pods with configuration Debug


Build target gRPC-Core of project Pods with configuration Debug


Build target gRPC of project Pods with configuration Debug


Build target gRPC-ProtoRPC of project Pods with configuration Debug


Build target FirebaseFirestore of project Pods with configuration Debug


Build target cloud_firestore of project Pods with configuration Debug


Build target Pods-Runner of project Pods with configuration Debug


Build target Runner of project Runner with configuration Debug

Ld /Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/Runner.app/Runner normal i386
    cd /Users/darrankelinske/source/flutter/austin-feeds-me-flutter/ios
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/BoringSSL -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/FirebaseAuth -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/FirebaseCore -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/FirebaseDatabase -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/FirebaseFirestore -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/GTMSessionFetcher -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/Protobuf -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/cloud_firestore -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/firebase_core -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/gRPC -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/gRPC-Core -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/gRPC-ProtoRPC -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/gRPC-RxLibrary -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/leveldb-library -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/nanopb -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/path_provider -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/shared_preferences -L/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/url_launcher -L/Users/darrankelinske/source/flutter/austin-feeds-me-flutter/ios/Flutter -F/Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator -F/Users/darrankelinske/source/flutter/austin-feeds-me-flutter/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/darrankelinske/source/flutter/austin-feeds-me-flutter/ios/Pods/FirebaseInstanceID/Frameworks -F/Users/darrankelinske/source/flutter/austin-feeds-me-flutter/ios/Pods/../.symlinks/flutter/ios -F/Users/darrankelinske/source/flutter/austin-feeds-me-flutter/ios/Flutter -filelist /Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/i386/Runner.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/i386/Runner_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lBoringSSL -lFirebaseAuth -lFirebaseCore -lFirebaseDatabase -lFirebaseFirestore -lGTMSessionFetcher -lGoogleToolboxForMac -lProtobuf -lc++ -lcloud_firestore -lfirebase_core -lgRPC -lgRPC-Core -lgRPC-ProtoRPC -lgRPC-RxLibrary -licucore -lleveldb-library -lnanopb -lpath_provider -lshared_preferences -lsqlite3 -lurl_launcher -lz -framework CFNetwork -framework FirebaseAnalytics -framework FirebaseCoreDiagnostics -framework FirebaseInstanceID -framework FirebaseNanoPB -framework Flutter -framework Foundation -framework MobileCoreServices -framework Security -framework StoreKit -framework SystemConfiguration -ObjC -lBoringSSL -lFirebaseAuth -lFirebaseCore -lFirebaseDatabase -lFirebaseFirestore -lGTMSessionFetcher -lGoogleToolboxForMac -lProtobuf -lc++ -lcloud_firestore -lfirebase_core -lgRPC -lgRPC-Core -lgRPC-ProtoRPC -lgRPC-RxLibrary -licucore -lleveldb-library -lnanopb -lpath_provider -lshared_preferences -lsqlite3 -lurl_launcher -lz -framework CFNetwork -framework FirebaseAnalytics -framework FirebaseCoreDiagnostics -framework FirebaseInstanceID -framework FirebaseNanoPB -framework Flutter -framework Foundation -framework MobileCoreServices -framework Security -framework StoreKit -framework SystemConfiguration -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Runner.app-Simulated.xcent -framework Flutter -framework App -lPods-Runner -Xlinker -dependency_info -Xlinker /Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/i386/Runner_dependency_info.dat -o /Users/darrankelinske/Library/Developer/Xcode/DerivedData/Runner-blzfibiocdhyedgaqedybuojiikn/Build/Products/Debug-iphonesimulator/Runner.app/Runner

ld: warning: ignoring file /Users/darrankelinske/Downloads/flutter/bin/cache/artifacts/engine/ios/Flutter.framework/Flutter, missing required architecture i386 in file /Users/darrankelinske/Downloads/flutter/bin/cache/artifacts/engine/ios/Flutter.framework/Flutter (3 slices)
Undefined symbols for architecture i386:
  "_FlutterMethodNotImplemented", referenced from:
      -[FLTCloudFirestorePlugin handleMethodCall:result:] in libcloud_firestore.a(CloudFirestorePlugin.o)
      -[FLTFirebaseCorePlugin handleMethodCall:result:] in libfirebase_core.a(FirebaseCorePlugin.o)
      ___47+[FLTPathProviderPlugin registerWithRegistrar:]_block_invoke in libpath_provider.a(PathProviderPlugin.o)
      ___52+[FLTSharedPreferencesPlugin registerWithRegistrar:]_block_invoke in libshared_preferences.a(SharedPreferencesPlugin.o)
      -[FLTUrlLauncherPlugin handleMethodCall:result:] in liburl_launcher.a(UrlLauncherPlugin.o)
  "_OBJC_METACLASS_$_FlutterStandardWriter", referenced from:
      _OBJC_METACLASS_$_FirestoreWriter in libcloud_firestore.a(CloudFirestorePlugin.o)
  "_OBJC_METACLASS_$_FlutterStandardReader", referenced from:
      _OBJC_METACLASS_$_FirestoreReader in libcloud_firestore.a(CloudFirestorePlugin.o)
  "_OBJC_METACLASS_$_FlutterStandardReaderWriter", referenced from:
      _OBJC_METACLASS_$_FirestoreReaderWriter in libcloud_firestore.a(CloudFirestorePlugin.o)
  "_OBJC_CLASS_$_FlutterStandardReaderWriter", referenced from:
      _OBJC_CLASS_$_FirestoreReaderWriter in libcloud_firestore.a(CloudFirestorePlugin.o)
  "_OBJC_CLASS_$_FlutterStandardWriter", referenced from:
      _OBJC_CLASS_$_FirestoreWriter in libcloud_firestore.a(CloudFirestorePlugin.o)
  "_OBJC_METACLASS_$_FlutterAppDelegate", referenced from:
      _OBJC_METACLASS_$_AppDelegate in AppDelegate.o
  "_OBJC_CLASS_$_FlutterStandardReader", referenced from:
      _OBJC_CLASS_$_FirestoreReader in libcloud_firestore.a(CloudFirestorePlugin.o)
  "_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
      objc-class-ref in libcloud_firestore.a(CloudFirestorePlugin.o)
      objc-class-ref in libfirebase_core.a(FirebaseCorePlugin.o)
      objc-class-ref in libpath_provider.a(PathProviderPlugin.o)
      objc-class-ref in libshared_preferences.a(SharedPreferencesPlugin.o)
      objc-class-ref in liburl_launcher.a(UrlLauncherPlugin.o)
  "_OBJC_CLASS_$_FlutterError", referenced from:
      objc-class-ref in libcloud_firestore.a(CloudFirestorePlugin.o)
      objc-class-ref in liburl_launcher.a(UrlLauncherPlugin.o)
  "_OBJC_CLASS_$_FlutterAppDelegate", referenced from:
      _OBJC_CLASS_$_AppDelegate in AppDelegate.o
  "_OBJC_CLASS_$_FlutterStandardMethodCodec", referenced from:
      objc-class-ref in libcloud_firestore.a(CloudFirestorePlugin.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)



Build failed    7/13/18, 9:48 PM

【问题讨论】:

【参考方案1】:

Raatty 在 Flutter discord 服务器中发现 Flutter 只支持 64 位 iOS 设备

Make sure your simulator is using a 64-bit device (iPhone 5s or later) by checking the settings in the simulator’s Hardware > Device menu.

来源:

https://flutter.io/setup-macos/

【讨论】:

以上是关于无法在 Xcode 中为 iPhone 4s Simulator 构建 Flutter 应用程序的主要内容,如果未能解决你的问题,请参考以下文章

无法在越狱的 iphone 4s 5.1.1 上打开 xcode 4.5.1 应用程序

Xcode 5 开发代码可以在 iPhone 4s 上运行

XCode 6. 架构

谁能告诉我为啥 Xcode 的新 beta 版不能在 iphone 4/4s 上模拟 io7 [关闭]

Xcode安全区域故障与iPhone SE和4s

xcode 没有 iphone4s 模拟器 的解决方法..