Flutter在启动时崩溃,仅限于iOS平台。

4

我已经查阅了以下内容:

启动构建iOS Flutter时崩溃 iOS应用程序启动时崩溃

但是没有一个能够解决我的问题。

这是我的Flutter Doctor -v:

Flutter 0.11.12 • channel dev • https://github.com/flutter/flutter.git
Framework • revision 06ec8d3b41 (34 hours ago) • 2018-11-29 19:20:18 -0500
Engine • revision 7375a0f414
Tools • Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

Running "flutter packages upgrade" in renalbase...          22.1s

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v0.11.13, on Mac OS X 10.14.1 18B75, locale en-SG)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Android Studio (version 2.3)
    ✗ Flutter plugin version 12.1 - the recommended minimum version is 16.0.0
[✓] VS Code (version 1.29.1)
[✓] Connected device (2 available)

• No issues found!

我能够构建项目但在IOS应用启动的时刻它会崩溃,无论是在模拟器还是实际设备上。而在Android上却没有问题。

下面是调试控制台输出:

Launching lib/main.dart on iPhone 5s in debug mode...
Xcode build done.                                           38.6s
*** First throw call stack:
(
0   CoreFoundation                      0x0000000113dcf1e6 __exceptionPreprocess + 294
1   libobjc.A.dylib                     0x000000011346c031 objc_exception_throw + 48
2   Runner                              0x0000000107b842ae +[FIRAnalytics logEventWithName:parameters:] + 0
3   libobjc.A.dylib                     0x000000011346cb04 CALLING_SOME_+initialize_METHOD + 19
4   libobjc.A.dylib                     0x000000011346ce9e _class_initialize + 276
5   libobjc.A.dylib                     0x0000000113473824 lookUpImpOrForward + 226
6   libobjc.A.dylib                     0x0000000113483414 _objc_msgSend_uncached + 68
7   Runner                              0x0000000107bdc3d1 -[FIRApp configureCore] + 705
8   Runner                              0x0<…>

非常感谢您的帮助!!万分感谢!

2018年12月1日更新: 运行iOS模拟器时弹出消息崩溃,是否有任何线索?

Process: Runner [33877]
Path: /Users/USER/Library/Developer/CoreSimulator/Devices/CF5D9DEE-1673-498C-B09B-308D3DAA06A2/data/Containers/Bundle/Application/A0426A01-844B-44DD-97FE-94C1048B870D/Runner.app/Runner
Identifier: Runner
Version: 0.6.71 (1)
Code Type: X86-64 (Native)
Parent Process: launchd_sim [3305]
Responsible: Runner [33877]
User ID: 501

Date/Time: 2018-11-30 18:20:17.794 +0800
OS Version: Mac OS X 10.14.1 (18B75)
Report Version: 12
Anonymous UUID: D4BCB92F-F89E-3A8B-2707-9DEEEB93E095


Time Awake Since Boot: 9500 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
*** Terminating app due to uncaught exception 'FIRAnalyticsVersionMismatch', reason: 'Google Analytics for Firebase version (50200000) does not match with Google App Measurement (50300000) version. Please update.'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 581.2 - Device: iPhone 5s - Runtime: iOS 11.3 (15E217) - DeviceType: iPhone 5s

Application Specific Backtrace 1:

你是否正确配置了Firebase?Firebase有一份指南,其中提供了逐步说明,以便为Flutter-iOS进行配置。 - MrPool
MrPool提供的链接,为方便起见:https://firebase.google.com/docs/flutter/setup - Sludge
1个回答

4

好的,我已经把它搞定了。

信息来源:https://github.com/invertase/react-native-firebase/issues/1633

我更改了我的podfile前几行:

# Uncomment this line to define a global platform for your project
platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

pod 'Firebase/Core'
pod 'FBSDKLoginKit' #optional
#GoogleAnalytics + GoogleAppMeasurement crashed due to version mismatch
pod 'GoogleAppMeasurement', '~> 5.2.0'

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接