首页 > 解决方案 > Flutter ios一启动就崩溃

问题描述

我已经检查了这些: 启动时崩溃 构建 iOS 颤振 IOS 应用程序启动时崩溃

但没有人能够解决我的问题。

这是我的颤振医生 -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 应用程序启动时,它崩溃了;Sim 和实际设备。安卓没问题。

这是调试控制台输出:

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<…&gt;

感谢任何帮助!非常感谢!

2018 年 12 月 1 日:更新弹出消息中的任何线索运行 ios Sim 崩溃:

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:

标签: iosflutter

解决方案


好的,我得到它的工作。信息来自: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'

推荐阅读