前提・実現したいこと
flutterを使用して、データベースにある内容をリスト表示するアプリを作っています。
Androidのシュミレーターでは、問題なく動作しましたが、iOSシュミレーターで作動させるとエラーが出ました。
firebase導入前は、iOSでも立ち上がりました。podファイルをpubspec.yamlに追加すると発生するようです。(firebase_core・firebase_databaseの両方や片方だけを入れても同様でした。)
よろしくお願いいたします。
エラー情報
app % flutter run Launching lib/main.dart on iPhone 11 Pro Max in debug mode... Running pod install... 5.3s Running Xcode build... └─Compiling, linking and signing... 5.9s Xcode build done. 39.5s Failed to build iOS app Error output from Xcode build: ↳ 2020-04-08 04:34:10.870 xcodebuild[97972:3208507] [MT] iPhoneConnect: ????<DVTiOSDevice (0x7ff32bc76900), Yo, iPhone, 13.3.1 (17D50), 00008020-000651E0262A002E> == Underlying device preparation errors == 2020-04-08 04:34:10.870 xcodebuild[97972:3208507] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode. Domain: com.apple.platform.iphoneos Code: 5 Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7ff32bd19860:'com.apple.platform.iphoneos':<DVTFilePath:0x7ff32bd19580:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0 User Info: { DVTDeviceDescription = "\Ud83d\Udcf1<DVTiOSDevice (0x7ff32bc76900), Yo, iPhone, 13.3.1 (17D50), 00008020-000651E0262A002E>"; } -- 2020-04-08 04:34:10.870 xcodebuild[97972:3208507] [MT] iPhoneConnect: ????<DVTiOSDevice (0x7ff32bc76900), Yo, iPhone, 13.3.1 (17D50), 00008020-000651E0262A002E> == END: Underlying device preparation errors == ** BUILD FAILED ** Xcode's output: ↳ === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug === <module-includes>:1:1: warning: umbrella header for module 'firebase_core' does not include header 'FirebaseCorePlugin.h' [-Wincomplete-umbrella] #import "Headers/firebase_core-umbrella.h" ^ 1 warning generated. 1 warning generated. === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug === Undefined symbols for architecture x86_64: "std::terminate()", referenced from: ___clang_call_terminate in FirebaseDatabase(APLevelDB.o) "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<std::nullptr_t>(char const*) in FirebaseDatabase(APLevelDB.o) "operator delete[](void*)", referenced from: leveldb::Status::~Status() in FirebaseDatabase(APLevelDB.o) "___cxa_begin_catch", referenced from: ___clang_call_terminate in FirebaseDatabase(APLevelDB.o) "leveldb::WriteBatch::WriteBatch()", referenced from: -[APLevelDBWriteBatch .cxx_construct] in FirebaseDatabase(APLevelDB.o) "leveldb::WriteBatch::~WriteBatch()", referenced from: -[APLevelDBWriteBatch .cxx_destruct] in FirebaseDatabase(APLevelDB.o) "leveldb::WriteBatch::Clear()", referenced from: -[APLevelDBWriteBatch clear] in FirebaseDatabase(APLevelDB.o) "_GULLoggerInitializeASL", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from: -[APLevelDB initWithPath:error:] in FirebaseDatabase(APLevelDB.o) -[APLevelDB dataForKey:] in FirebaseDatabase(APLevelDB.o) -[APLevelDB stringForKey:] in FirebaseDatabase(APLevelDB.o) "leveldb::Status::ToString() const", referenced from: -[APLevelDB initWithPath:error:] in FirebaseDatabase(APLevelDB.o) "___gxx_personality_v0", referenced from: +[APLevelDB levelDBWithPath:error:] in FirebaseDatabase(APLevelDB.o) -[APLevelDB initWithPath:error:] in FirebaseDatabase(APLevelDB.o) -[APLevelDB setData:forKey:] in FirebaseDatabase(APLevelDB.o) -[APLevelDB setString:forKey:] in FirebaseDatabase(APLevelDB.o) -[APLevelDB dataForKey:] in FirebaseDatabase(APLevelDB.o) -[APLevelDB stringForKey:] in FirebaseDatabase(APLevelDB.o) -[APLevelDB removeKey:] in FirebaseDatabase(APLevelDB.o) ... "_OBJC_CLASS_$_GULAppEnvironmentUtil", referenced from: objc-class-ref in FirebaseCore(FIRApp.o) objc-class-ref in FirebaseCore(FIRBundleUtil.o) "_GULResetLogger", referenced from: _FIRResetLogger in FirebaseCore(FIRLogger.o) "leveldb::WriteBatch::Delete(leveldb::Slice const&)", referenced from: -[APLevelDBWriteBatch removeKey:] in FirebaseDatabase(APLevelDB.o) "_GULIsLoggableLevel", referenced from: _FIRIsLoggableLevel in FirebaseCore(FIRLogger.o) "leveldb::Options::Options()", referenced from: +[APLevelDB defaultCreateOptions] in FirebaseDatabase(APLevelDB.o) "_GULSetLoggerLevel", referenced from: _FIRSetLoggerLevel in FirebaseCore(FIRLogger.o) "leveldb::DB::Open(leveldb::Options const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::DB**)", referenced from: -[APLevelDB initWithPath:error:] in FirebaseDatabase(APLevelDB.o) "_GULLoggerRegisterVersion", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) "_GULLogBasic", referenced from: _FIRLogBasic in FirebaseCore(FIRLogger.o) "_GULLoggerEnableSTDERR", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) "leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)", referenced from: -[APLevelDBWriteBatch setData:forKey:] in FirebaseDatabase(APLevelDB.o) -[APLevelDBWriteBatch setString:forKey:] in FirebaseDatabase(APLevelDB.o) "_GULLoggerForceDebug", referenced from: ___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Could not build the application for the simulator. Error launching application on iPhone 11 Pro Max.
ファイルや実行情報など
pubspec.yaml
name: app description: A new Flutter project. https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html version: 1.0.0+1 environment: sdk: ">=2.1.0 <3.0.0" dependencies: flutter: sdk: flutter cupertino_icons: ^0.1.2 url_launcher: ^5.4.1 map: any path_provider: ^0.4.1 http: any # firebase_core: ^0.2.5 firebase_database: ^3.1.3 intl: ^0.15.7 dev_dependencies: flutter_test: sdk: flutter flutter: uses-material-design: true - assets/book.pdf - assets/IMG_9826.JPG
% flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, v1.15.17, on Mac OS X 10.15.4 19E266, locale ja-JP) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 11.4) [✓] Chrome - develop for the web [✓] Android Studio (version 3.6) [✓] VS Code (version 1.43.2) [✓] Connected device (3 available) • No issues found!
他に発生したエラー
解決済みですが、レファレンスとは違うため念のため書いておきます。
firebase_coreとfirebase_databaseで競合エラーかなにかが起きているらしく、
firebase_coreをpodから削除したら、Androidでは動作しました。
% flutter packages get Running "flutter pub get" in app... Because firebase_database 3.1.3 depends on firebase_core ^0.4.0 and no versions of firebase_database match >3.1.3 <4.0.0, firebase_database ^3.1.3 requires firebase_core ^0.4.0. So, because app depends on both firebase_core ^0.2.5 and firebase_database ^3.1.3, version solving failed. pub get failed (1; So, because app depends on both firebase_core ^0.2.5 and firebase_database ^3.1.3, version solving failed.) exit code 1
試したこと
https://github.com/flutter/flutter/issues/15168
に似たエラーがあったのですが、バージョンが古く使えませんでした。
バージョンを1.4.0にすれば、一部で直ったそうですが、自分の環境ですると
Warning: CocoaPods minimum required version 1.6.0 or greater not installed. Skipping pod install. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade: sudo gem install cocoapods
のエラーが発生します。
補足情報(FW/ツールのバージョンなど)
使用したCocoaPods のバージョン:1.9.1
あなたの回答
tips
プレビュー