Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FirebaseApp.configure() EXC_BAD_ACCESS in CFStringGetLength since Xcode 9/iOS 11 #301

Closed
tomasharkema opened this issue Sep 21, 2017 · 8 comments

Comments

@tomasharkema
Copy link

tomasharkema commented Sep 21, 2017

[READ] Step 1: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request make sure the issue title starts with "FR:".
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: Xcode 9 (9A235)
  • Firebase SDK version: Firebase/Core 4.2.0
  • Library version: Firebase/Database 4.2.0, FirebaseAnalytics 4.0.3
  • Firebase Product: database/analytics (auth, database, storage, core, messaging, etc)

[REQUIRED] Step 3: Describe the problem

When I configure the FirebaseApp (by calling FirebaseApp.configure()), we get a EXC_BAD_ACCESS in CFStringGetLength. This happens since Xcode 9/iOS 11.

schermafbeelding 2017-09-21 om 09 10 36

Steps to reproduce:

  • Have a firebase project configured with analytics and database.
  • Call FirebaseApp.configure()
  • 💥

Relevant Code:

import UIKit
import FirebaseCore

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    FirebaseApp.configure()
...
  }
...
}
@tomasharkema tomasharkema changed the title FirebaseApp.configure() EXC_BAD_ACCESS in CFStringGetLength FirebaseApp.configure() EXC_BAD_ACCESS in CFStringGetLength since Xcode 9/iOS 11 Sep 21, 2017
@eburley
Copy link

eburley commented Sep 21, 2017

A few questions:

  • What's your podfile setup?
  • Is your GoogleService-info.plist file embedded in the app correctly?
  • Have you added a GTM container file to the bundle?

@eburley
Copy link

eburley commented Sep 22, 2017

Followup question: Are you using cocoapods, or are you downloading the frameworks and manually configuring them? If so, note that there is a resource bundled into the TagManager framework that needs to be included.

@tomasharkema
Copy link
Author

Thanks for your response @eburley. Let me elaborate:

  • We've setup firebase via Cocoapods. The setup is as follows:
workspace 'Project.xcworkspace'
platform :ios, '9.0'

abstract_target 'Shared' do
  use_frameworks!

  # These pods are available to all targets

  target 'Project' do
    project 'ios/Project.xcodeproj'

    # Native Pods specific for Project
    ..some pods
    pod 'GoogleTagManager', '~> 6.0'
    pod 'Firebase/Database'
    ...more pods
  end
end
  • GoogleService-info.plist is embedded properly. Our project compiles and runs in Xcode 8 and iOS 10 without a hassle.
  • Yes, the GTM container file is setup correctly.

After some digging I found that if I disable the new buildsystem (which I enabled since Xcode 9 came out), I consistently can compile and run the project. This is probably a hint. Maybe bundles aren't handled correctly with the new build system?

@paulb777
Copy link
Member

@tomasharkema Thanks for digging deeper and sharing.

It looks like we're seeing CocoaPods/CocoaPods#6936. There is at currently an incompatibility between CocoaPods bundles and the beta version of the Xcode 9 build system.

@tomasharkema
Copy link
Author

@paulb777 thanks, that makes sense, we've have the same issue with TwitterKitResources.bundle, as described in the CocoaPods issue.

I'll close the issue, and we'll await the issue to be resolved at CocoaPods'. Maybe you could consider making a remark on the readme that the new buildsystem has issues with the latest Cocoapods and Firebase setup?

@mattwritescode
Copy link

mattwritescode commented Oct 31, 2017

I'm seeing this exact issue using binary framework files, though I had to get those binary frameworks from a cocoa pods-enabled app, since they aren't distributed any other way. The bundle is included in my GoogleTagManager framework. It occurs no matter what build process I'm using.

Edit: I was able to get it working by adding the TagManagerResources.bundle into the project and dropping it into Copy Bundle Resources manually. Even though it was within the Resources folder inside the GoogleTagManager.framework, it was not being found automatically (most likely this is taken care of by a normal Cocoapods install configuration).

@paulb777
Copy link
Member

Now fixed on CocoaPods master : CocoaPods/CocoaPods#7209

@ergunkocak
Copy link

With xcode 9.2 and cocoapods 1.4.0.beta.2 problem still exists as @tomasharkema wrote at first place.

@firebase firebase locked and limited conversation to collaborators Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants