Firebase initWithUrl 在 iOS 5.1 上崩溃

Posted

技术标签:

【中文标题】Firebase initWithUrl 在 iOS 5.1 上崩溃【英文标题】:Firebase initWithUrl crashes on iOS 5.1 【发布时间】:2015-04-29 06:55:13 【问题描述】:

我正在开发一个 Firebase 应用,以在我的第一代旧 iPad (ios 5.1.1) 上使用。它在模拟器和其他设备上运行良好,但是当我将它加载到 iPad 上进行测试时,我收到了这样的崩溃:

#0  0x33860f86 in objc_msgSend ()
#1  0x33862f94 in objc_retain ()
#2  0x000d26a0 in -[FRepoManager setQueue:] at /Users/mtse/Dev/firebase/firebase-client-objc/Firebase/Firebase/Core/FRepoManager.m:24
#3  0x33fdc5aa in dispatch_once_f$VARIANT$up ()
#4  0x000d1a80 in _dispatch_once [inlined] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/dispatch/once.h:68
#5  0x000d1a70 in +[FRepoManager singleton] at /Users/mtse/Dev/firebase/firebase-client-objc/Firebase/Firebase/Core/FRepoManager.m:37
#6  0x000e6736 in -[Firebase initWithUrl:] at /Users/mtse/Dev/firebase/firebase-client-objc/Firebase/Firebase/Firebase.m:54
#7  0x000c6f82 in -[AppDelegate application:didFinishLaunchingWithOptions:] at /xxx/AppDelegate.m:25
#8  0x3337acaa in -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] ()
#9  0x333747dc in -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] ()
#10 0x33342ac2 in -[UIApplication handleEvent:withNewEvent:] ()
#11 0x33342566 in -[UIApplication sendEvent:] ()
#12 0x33341f3a in _UIApplicationHandleEvent ()
#13 0x3393422a in PurpleEventCallback ()
#14 0x35c16522 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#15 0x35c164c4 in __CFRunLoopDoSource1 ()
#16 0x35c15312 in __CFRunLoopRun ()
#17 0x35b984a4 in CFRunLoopRunSpecific ()
#18 0x35b9836c in CFRunLoopRunInMode ()
#19 0x3337386a in -[UIApplication _run] ()
#20 0x33370cd4 in UIApplicationMain ()
#21 0x000c778c in main at /xxx/main.m:14

一旦代码到达这一行,就会发生这种情况:

    Firebase *ref = [[Firebase alloc] initWithUrl:kFirebaseURL];

我什至尝试将 Firebase 框架降级为较旧的框架,但问题仍然存在。我也设置了 -ObjC 链接器标志。关于如何解决这个问题的任何想法?

【问题讨论】:

【参考方案1】:

抱歉,Firebase SDK 不再支持 iOS 5.x。你可以试试 SDK 的old versions 看看有没有用,但我不知道。

【讨论】:

【参考方案2】:

您可以通过降级到框架的v1.0.8 来解决此问题(直接链接到 ZIP 文件)——这是在装有 iOS 5.1.1 的 iPad 1 上不会出现此崩溃的最新版本。

【讨论】:

以上是关于Firebase initWithUrl 在 iOS 5.1 上崩溃的主要内容,如果未能解决你的问题,请参考以下文章

FireBase iOS queryOrderedByChild 不起作用

Firebase如何检查交易成功或失败?

[iOS]集成环信SDK然后运行时候crash了-[NSBundle initWithURL:]: nil URL argument'

将图片上传到 Firebase

ASIHTTPRequest 在 iOS 3.1.3 上崩溃

记iOS扩展(匿名类别)使用引发的崩溃