invertase / firestore-ios-sdk-frameworks

⚡ Precompiled Firestore iOS SDKs extracted from the Firebase iOS SDK repository release downloads for faster build times.
Apache License 2.0
427 stars 48 forks source link

FirebaseFirestore as packaged here is missing direct dependency on nanopb #59

Closed mikehardy closed 7 months ago

mikehardy commented 1 year ago

1- FirebaseFirestore requires nanopb 2- Upstream, FirebaseCore used to depend on FirebaseCoreDiagnostics, which transitively gave us a dependency on nanopb 3- FirebaseCoreDiagnostics was removed from FirebaseCore dependency chain for v10+ of firebase-ios-sdk meaning we no longer have this "free" transitive dependency

  1. "most" other modules also depend directly or transitively on nanopb but not all do:
    • Have nanopb: analytics (via GoogleAppMeasurement), app-distribution (via GoogleDataTransport), crashlytics, in-app-messaging, messaging, performance
    • Do not have nanopb: all the rest (e.g., app-check, auth, database, dynamic-links, firestore, functions, installations, ml, remote-config, storage)
      1. Any combination of modules that includes this distribution of FirebaseFirestore without also including one of the other modules that depends on nanopb will result in nanopb not being found and a build failure

Temporary resolution is to add a dependency on nanopb with correct version constraints to consumers of this dependency:

https://github.com/firebase/firebase-ios-sdk/blob/bb4c6382cd52e805a721f981c1838eaa815f6dbd/FirebaseFirestore.podspec#L105

  s.dependency 'nanopb', '>= 2.30908.0', '< 2.30910.0'

More complete fix will involve adding something similar to the leveldb dependency here, where we attempt to detect if leveldb exists by examining the other deps to see if one of them is in the list above, or allowing consumer to specify it directly, or...something else if there is a better solution

mikehardy commented 1 year ago

Worth noting that temporarily both FlutterFire and react-native-firebase have this workaround / direct dependency in their firestore podspecs so this is not an urgent issue for the two largest potential consumers of this repository

But if you depend on this repository directly in another form, you quite likely will need to add the nanopb dependency as described in code snippet above until the issue is resolved

esjot commented 1 year ago

Hi, I have similar issue with nativesript/angular. Is it a fix I can apply in my project or hat it to be done by nativescript?