firebase / quickstart-cpp

Firebase Quickstart Samples for C++
https://firebase.google.com/games
Apache License 2.0
206 stars 122 forks source link

CocoaPods missing libraries present in the Firebase iOS download zip #10

Closed adolby closed 6 years ago

adolby commented 6 years ago

Operating system: iOS Operating system version: 10.3

What steps will reproduce the problem:

  1. Attempt to build the analytics quickstart-cpp example after adding -I"path/to/firebase_cpp_sdk" to testapp.xcodeproj Build Settings -> Other C++ flags section.

What is the expected result? A successful build.

What happens instead of that?

Receiving these link errors from Xcode:

directory not found for option '-L/Users/andrew/Library/Developer/Xcode/DerivedData/testapp-hgkipipkgriqnvgtfxrgsayxbsga/Build/Products/Debug-iphoneos/GoogleToolboxForMac'

ld: library not found for -lGoogleToolboxForMac

In the Firebase iOS download zip, a framework for GoogleToolboxForMac is present in the Analytics folder. However, the CocoaPods subproject does not include this framework. This also seems to be the case for FirebaseNanoPb.framework, nanopb.framework, and Protobuf.framework for the Messaging and Remote config modules.

isipisi89 commented 6 years ago
jonsimantov commented 6 years ago

Hi,

Could you please confirm you are following these steps (also listed in the readme file):

  1. Run "pod install" in the analytics/testapp directory to download and install the required Firebase iOS Cocoapods.
  2. Ensure your GoogleService-Info.plist file is present in the analytics/testapp directory.
  3. Using Xcode, open the "testapp.xcworkspace" file (NOT the "testapp.xcodeproj" file - the .xcworkspace file is required for Cocoapods to work).
  4. In the Firebase C++ SDK you downloaded, navigate to the frameworks/ios/universal directory and locate firebase.framework and firebase_analytics.framework. Drag these two files into the Xcode window with your project open, into the the "Frameworks" folder of your project. If you are prompted by Xcode, ensure the "Copy items if needed" option is ✔checked.

You should then be able to compile and run the Firebase Analytics C++ testapp. Please reply and let me know if this works or if you continue to have issues.

Thanks!

Jon

adolby commented 6 years ago

Thank you for your help, Jon.

Using firebase.framework and firebase_analytics.framework allowed me to successfully build the quickstart analytics example.

I was trying to link against the static libraries in firebase_cpp_sdk/libs/ios/universal instead of the frameworks in firebase_cpp_sdk/frameworks/ios/universal.

The pod previously had the dependencies to link in this way, but now I can only find these in the Firebase-4.0.4.zip from https://firebase.google.com/download/ios.

I'll report back the results of trying to link the project I'm working on with the frameworks in firebase_cpp_sdk/frameworks/ios/universal.

jonsimantov commented 6 years ago

I'll close this issue for now since your problem is resolved, but if you have any issues linking the universal frameworks in your own project, please feel free to re-open it.