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

Depending on both Firebase/Firestore and SVGKit pods in the same app leads to a build error. #4035

Closed
LipYoung opened this issue Oct 10, 2019 · 7 comments · Fixed by #4054
Closed
Assignees
Milestone

Comments

@LipYoung
Copy link

LipYoung commented Oct 10, 2019

  • Xcode version: 11
  • Firebase SDK version: Firebase/Firestore 6.7.0
  • Firebase Component:
  pod 'Firebase/Firestore'
  • pod version: 1.8.1
  • macos version: 10.14.6

[REQUIRED] Step 3: Describe the problem

If I add the Firestore edit to the newly created project, an error will occur. If you remove the Firestore edit, it will be fine.

如果我在新创建的工程中添加Firestore编辑就会出现错误。如果移除Firestore编辑就正常了。

Steps to reproduce:

1 use xcode 11.0(11A420a) create new ios project.
2 use podfile.
3 run pod install.
4 run command + b.

Relevant Code:

podfile content:

platform :ios, '10.0'
inhibit_all_warnings!

target 'TestFirebase' do
  use_frameworks!
  pod 'SVGKit', '3.0.0-beta1'
  pod 'Firebase/Firestore'
end
@paulb777
Copy link
Member

What is the error?

Please share the created project.

@firebase firebase deleted a comment from google-oss-bot Oct 10, 2019
@LipYoung
Copy link
Author

LipYoung commented Oct 10, 2019

image

This is error info.

Firebase/Firestore can not work with SVGKit.

@paulb777 thx your reply.

@LipYoung
Copy link
Author

TestFirebase.zip

i uploading this test project.

@LipYoung LipYoung changed the title Xcode 11 create new project use Firestore wil build error. Firebase/Firestore can not work with SVGKit. it wil build error. Oct 10, 2019
@var-const var-const self-assigned this Oct 10, 2019
@var-const
Copy link
Contributor

Thank you for the report. I will try to reproduce the issue right now using the project you provided and will post back the results.

@var-const
Copy link
Contributor

Quick update: SVGKit accidentally imports a header file from Firestore instead of its own header. One of the reason it happens is that SVGKit imports using short file names, and the file name is really common (Document.h). The issue appears to be related to header maps. I'll post another update once I have it -- I'll continue investigating the issue.

var-const added a commit that referenced this issue Oct 14, 2019
See #4035: a certain combination of pods can lead to a broken build. The underlying issue is that CocoaPods generate a header map that includes headers from _all_ the pods in a project. A header map maps short file names to full paths and is unable to handle collisions; thus, in a CocoaPods-based build, if one pod contains a header with a common name, and the other pod tries to import a header with the same short name by relying on header maps (without specifying a longer path), the header from one pod may end up getting erroneously picked up by the other pod.

In that particular case, `SVGKit` is relying on header maps and trying to import `Document.h`, which, for reasons described above, happens to pick up `document.h` from Firestore. However, since header maps cannot handle collisions in general, this could manifest with other pods as well.

The workaround is to avoid adding Firestore header files (except the public ones) to sources.

See facebook/react-native#14326, which describes the same problem.

Fixes #4035.
@var-const
Copy link
Contributor

var-const commented Oct 14, 2019

@LipYoung #4054 is a workaround for the issue; it will be a part of the next release, but if you'd like to try it out sooner, you can use the commit with the workaround in your Podfile:

pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'pull/4054/head'

(notice no slash in FirebaseFirestore -- that's the name of the development pod).

P.S. Thanks a lot for the repro project! It certainly helped us track down the issue much faster.

@var-const var-const changed the title Firebase/Firestore can not work with SVGKit. it wil build error. Depending on both Firebase/Firestore and SVGKit pods in the same app leads to a build error. Oct 14, 2019
@paulb777 paulb777 added this to the M58 milestone Oct 14, 2019
@LipYoung
Copy link
Author

@var-const thx. This it help for me.

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

Successfully merging a pull request may close this issue.

4 participants