buck icon indicating copy to clipboard operation
buck copied to clipboard

How can I integrate Firebase for a Swift app using Buck?

Open antongorb opened this issue 5 years ago • 3 comments

I am trying to use Buck to include the Firebase in iOS app I am working on but no luck can you help please?

antongorb avatar Apr 10 '20 15:04 antongorb

I don't understand does BUCK can work with the new XCFrameworks packaging format?

antongorb avatar Apr 10 '20 15:04 antongorb

I think that XCFrameworks have benefits only to apps that will run in Catalyst too. You can get those frameworks inside of Firebase’s xcframework, delete the catalyst one and merge x84_64 (for simulator) with arm64(and others archs accepted for your app) libraries with lipo and use that framework in buck with prebuilt_apple_framework

Lcsmarcal avatar Aug 06 '20 03:08 Lcsmarcal

I am trying to use Buck to include the Firebase in iOS app I am working on but no luck can you help please?

the simplest solution would be using Carthage prebuilt frameworks and buck rule prebuilt_apple_framework with preferred linkage to static

for example - your Cartfile:

binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == YOUR_VERSION
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseProtobufBinary.json" == YOUR_VERSION
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebasePerformanceBinary.json" == YOUR_VERSION
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json"
github "google/promises" // compile error without it (in my case)

and BUCK file for carthage deps:

prebuilt_apple_framework(
    name = "Firebase",
    framework = "Build/iOS/Firebase.framework",
    preferred_linkage = "static",
    visibility = ["PUBLIC"],
)
// ... and so on for every framework which downloaded for firebase

ps: small tip - frameworks in google/promises should be linked as "shared". btw, I tested with version 6a45969732f74dc0b28015bbba7441b678afe4c2. in earlier version preferred_linkage generate incorrect Xcode project

Hope it helps

BlakeRxxk avatar Oct 20 '20 08:10 BlakeRxxk