Skip to content

Multiple/Duplicate Protobuf Dependencies of Carthage Binary Firebase Components #5276

Closed
@ffittschen

Description

@ffittschen

Step 1: Describe your environment

  • Xcode version: 11.4
  • Firebase SDK version: 6.21.0
  • Firebase Component: Remote Config, Messaging (and all other components depending on Protobuf)
  • Component version: n/a
  • Installation method: Carthage

Step 2: Describe the problem

The usage description of the Carthage documentation states that we should add a subset of the provided components to the Cartfile of a project that uses Firebase as their dependency.

The problem is: Multiple of those components internally depend on Protobuf and all of them bundle their own Protobuf.framework within the zip file used for binary distribution.

Example:

RemoteConfig
├── FirebaseABTesting.framework
├── FirebaseRemoteConfig.framework
└── Protobuf.framework

Messaging
├── FirebaseMessaging.framework
└── Protobuf.framework

When Carthage downloads these zip files it will extract its contents into the Carthage/Build/<platform> folder.

If a project depends on multiple Firebase components that depend on Protobuf, Carthage will always fail with an error like the following.

Failed to write to /Users/ffittschen/Firebase_Test/Carthage/Build/iOS/Protobuf.framework: Error Domain=NSCocoaErrorDomain Code=513 "“Protobuf.framework” couldn’t be removed because you don’t have permission to access it." UserInfo={NSUserStringVariant=(
Remove
), NSFilePath=/Users/ffittschen/Firebase_Test/Carthage/Build/iOS/Protobuf.framework, NSUnderlyingError=0x7fb827104db0 {Error Domain=NSPOSIXErrorDomain Code=66 "Directory not empty"}}

Steps to reproduce:

  1. Create a Cartfile with this content:
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMessagingBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json"
  1. Run carthage update --platform iOS

Proposed solution:

I would like to propose to either distribute Protobuf seperately instead of being bundled within multiple Firebase components, or bundle it with the Firebase Analytics component, which should always be included according to the Carthage documentation.

The Cartfile with a separate Protobuf component could look as follows. If Protobuf would be bundled within the Analytics component, the Cartfile would not look different than existing Cartfiles

Cartfile with separate Protobuf component
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/Protobuf.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMessagingBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions