Admob / Firebase integration problem

Hi,
I’m trying to implement Admob and Firebase to my project. I’m developing with xCode in c++. iPhone App.

Unfortunately I have configuration problems. I read this guide to implement the Firebase c++ SDK: https://firebase.google.com/docs/cpp/setup and also I read a lot of comments in google, but I it does not work.

First of all, I have problems with CocoaPods (I created the Podfile and I added the respective pod’s) and when I run “pod install” I have this error:

[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

I tried to expand the buffer and the same error appears.
So, then, I tried to integrate the framework without Pods.
I read this instructions: https://firebase.google.com/docs/ios/setup#frameworks

The problem is, when I add the frameworks to the “Linked Frameworks”

image

and I compile it, I have this error:

Apple Mach-O Linker Error
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What could be my problem?
Thanks

I added the framework’s and GoogleService-Info.plist correctly to the project. It compiles. My problem is when I add:

#import "Firebase.h"

To AppDelegate.h.
I have more than 20 errors (Semantic and Parse Issue).

I’m not quite sure but if everything is correctly setup, try this one:

#import <Firebase.h>

instead of

#import "Firebase.h"

@macmoy thanks for the answer.
I tried <> instead of “” but it does not work either.
I think my problem is the configuration. I can’t install Firebase with CocoaPods (I’m having an error that I said in my first post). So, I’m trying to configurate it manually.

I downloaded the Firebase C++ SDK and I included all of “.frameworks” files to my project. The project compiles fine, but when I try to include any file in the code, it does not work. What configuration would I miss?

Thanks

include_path

@yinjimmy thanks for the answer, but I did not understand you. What should I do?

Why u not using sample app alredy integrated with cocos2d-x? There is official example from google have a try:D

I would like to include Firebase in my already created project.
I think the best way is to use CocoaPods but it does not work me. This is the reason because I tried to install it manually, but it does not work either.

Supposing I want to try again to use CocoaPods.
I’m following this steps: https://firebase.google.com/docs/admob/cpp/cocos2d-x?hl=es-419

But when I run the command “pod install” or “pod update” this is my error:

Admins-Mac:proj.ios_mac admin$ pod install
    Setting up CocoaPods master repo
      $ /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
      Cloning into 'master'...
      remote: Counting objects: 1518322, done.        
      remote: Compressing objects: 100% (2737/2737), done.        
      error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
      fatal: The remote end hung up unexpectedly
      fatal: early EOF
      fatal: index-pack failed
    [!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
    You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

    [!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.

I tried everything: re-install cocoapods, re-install ruby and brew, go to ~/.cocoapods/repos and run git clone https://github.com/CocoaPods/Specs.git master, run pod setup, clear buffers, change Build Settings…

Really I do not know what else to try. I am desperate to solve this, I have this problem since 5 days ago. Anyone can help me?

Here is the log with pod update:

Admins-Mac:proj.ios_mac admin$ pod update
Update all pods
Setting up CocoaPods master repo
  $ /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
  Cloning into 'master'...
  remote: Counting objects: 1518367, done.        
  remote: Compressing objects: 100% (2407/2407), done.        
  error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
  fatal: The remote end hung up unexpectedly
  fatal: early EOF
  fatal: index-pack failed
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

[!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.

“Receiving objects” is stopped at 42% or 9% or… random number, and after that 10…20… minutes, this is the final log.

I solved the CocoaPods problem.

I used the command:
git clone git@github.com:CocoaPods/Specs.git master

Instead of:
git clone https://github.com/CocoaPods/Specs.git master

Now, I have the Firebase Libraries and Dependences correctly installed.
But… as always, i’m having a new problem. Maybe anyone can help me.
If I compile the project, it’s works. But when I add this lines:

#include "firebase/app.h"
#include "firebase/admob.h"

The project does not compile. This is the error:

Apple Mach-O Linker (ld) Error Group
OBJC_CLASS$_FIRApp”, referenced from:
OBJC_CLASS$_FIROptions”, referenced from:
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried to add $(inherited) in Build Settigs > “Other Linker Flags” and these errors disappear, but this persist:

Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)