EXC_BAD_ACCESS code=2 on including Firebase/Auth in Podfile

随声附和 提交于 2019-12-18 21:50:49

问题


I am getting EXC_BAD_ACCESS after including 'Firebase/Auth' in Podfile. This happens without adding any line of firebase code. I am using swift3 on xcode 8 and the resultant pods are -

Installing Firebase (3.8.0)
Installing FirebaseAnalytics (3.5.1)
Installing FirebaseAuth (3.0.6)
Installing FirebaseCore (3.4.4)
Installing FirebaseInstanceID (1.0.8)
Using GTMOAuth2 (1.1.4)
Using GTMSessionFetcher (1.1.7)
Using GoogleAppUtilities (1.1.2)
Installing GoogleInterchangeUtilities (1.2.2)
Using GoogleSignIn (4.0.1)
Using GoogleSymbolUtilities (1.1.2)
Installing GoogleToolboxForMac 2.1.0 (was 2.1.0)
Using Localize-Swift (1.6)
Using ProtocolBuffers-Swift (3.0.6)
Using QorumLogs (0.9)

The error comes in Thread 1 in [UIViewController(FIRAScreenClassName) fira_viewDidAppear:]:

This happens only if the pod target is itself a framework which is embedded in an app eventually.

I do have Google analytics as well. Is it because ARC is not enabled? How do I do that on xcode-8? Any other options to try?


回答1:


There appears to be a problem in the latest Firebase/Core (3.8.0) release. Even @IBDesignable was crashing with a recursive call to the method signature you mentioned.

You have a couple of options:

  1. In Info.plist (app), set FirebaseAutomaticScreenReportingEnabled to NO (bool). This solved the problem for my running application, but IBDesignable resources caused this error on build:

file:///path/to/project/Base.lproj/Main.storyboard: error: IB Designables: Failed to render and update auto layout status for UIViewController (svZ-78-1Mn): The agent crashed

  1. You may want to temporarily downgrade to 3.7.1, for example,

    pod 'Firebase/Core', '~> 3.7.1'
    pod 'Firebase/Auth'
    pod 'Firebase/Database'
    

The rest of the dependencies should take care of themselves when you run pod update.




回答2:


I am suspecting that the Podfile is not correct. I got into similar problem by adding Firebase dependency into a framework and I ran into the problem like this

objc[12345]: Class FIRAAppEnvironmentUtil is implemented in both /Users/...Build/Products/Debug-iphonesimulator/SomeFramework.framework/SomeFramework (0x105ef7fc8) and /Users/.../CurrentProject.app/CurrentProject (0x105945108). One of the two will be used. Which one is undefined.

As mentioned in this post, you might have duplicate dependencies in different targets which could lead to weird bug like this. Adding Firebase pod into the main target and removing the Firebase pod from the framework fixed the problem for me.




回答3:


I made a silly mistake. Never turned on Google under Authentication -> Sign in methods on Firebase



来源:https://stackoverflow.com/questions/40304432/exc-bad-access-code-2-on-including-firebase-auth-in-podfile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!