Some issues with Firebase C++ on IOS

436 views
Skip to first unread message

syl

unread,
May 30, 2016, 3:08:03 AM5/30/16
to Firebase Google Group
Hello,

Trying to use firebase C++ on IOS, with AdMob and Analytics :

I have noticed there are three archives :

A/ Firebase C++ SDK
https://firebase.google.com/docs/cpp/setup#dependencies

B/ Framework SDK
https://firebase.google.com/docs/ios/setup#available_pods

C/ Admob IOS Only SDK
https://firebase.google.com/docs/admob/ios/download

I want to use the C++, but without cocapod.
But, got some issues :

1/ Cannot find the include "#include <cstdint>" in file "firebase_cpp_sdk/include/firebase/analytics.h"
though it can find the file "#include <tr1/cstdint>".

2/ Since I didn't want to use cocoapod, I try to use the set of framework from the zip file B/
=> it's really not clear what is needed.

there are always undefined function references to frameworks.
(currently my list is : AVFoundation CoreMedia CoreTelephony, EventKit, EventKitUI, AddressBook MessageUI ... )
it also require:
 some compression "deflate" function (libz ?).
 some "std::__1::__vector ... " , which STL is that ?
 "_GADAdSizeFromGGSize, is this the archive [C] ?
 

There are IOS frameworks in [A] and [B], which one are needed ?
There are also IOS libs (libadmob.a, libanalytucs.a, libapp.a) in [A] for IOS, are they needed ?


3) You will probably ask what is my use case ...
- I'd like to use the same code as with my android app. For this reason, I want to use C++.
- I'd prefer to have no inter-action with xcode-project at all, not even cocoapod.
  I use CMake for +40 projects, it works pretty well. It allows to save my project into a versionning system,
  and to regenerated the xcode project when I want.
  (xcode a pretty useless to IDE, and you always end up screwing up you project file with it !)
 
   So I only need to write into my CMakeLists.txt  the correct frameworks to use, the correct paths for includes and directories.
   But, currently, this is really not clear to me what those information are.

Thanks for you help,
Cheers

 








Jon Simantov

unread,
May 31, 2016, 10:05:06 PM5/31/16
to Firebase Google Group
Hi Syl,

Thanks for posting!

So for iOS, the frameworks from [A] you'll want to use are the ones in the "frameworks/ios/universal" directory. This should provide the include files as well.  As long as you are using the firebase.framework, firebase_analytics.framework, firebase_admob.framework, etc. then you don't need the libapp.a, libanalytics.a, libadmob.a files; those are provided for users who do not want to use frameworks on iOS for whatever reason.

For [B], I agree that it's a little confusing which frameworks you'll need since usually people will let Cocoapods manage the dependencies for them:
- For Analytics, you'll need all of the frameworks inside the Firebase/Analytics directory.
- For AdMob, you'll need the framework inside the Firebase/AdMob directory from the zipfile, as well as the framework [C] you mentioned. Everything inside Firebase/Analytics is also required.

A few things that might help you with your other issues. First, it looks like you are using libstdc++, which is deprecated on iOS. Try switching your project to use libc++ instead. You will also need to link libz, which should be a standard system library, as it's required by some of the Firebase libraries.

Second, the "_GADAdSizeFromGGSize" error is related to Admob functions being defined from inside C++ without an extern "C" block -- but this should be fixed in the latest version of the Google Mobile Ads SDK that you linked (7.8.1). Is that the version you are using? Could you try downloading it again, and ensure that that version is the one your app is using?

Hope this helps!

Jon

syl

unread,
Jun 1, 2016, 6:21:01 AM6/1/16
to Firebase Google Group
hi Jon,

Thanks for you precisions ! I added libz and libsqlite3, plus using libc++. It seems to work a little better now !

I have the version 7.8.1 but I got another issue with it (already reported), so currently I'm stuck.
For the moment, I down-graded to admob 7.7.0.
Don't know if Firebase can work with admob 7.7.0 ?
So far, all (firebase, admob, analytics) can be initialized with no crash, but it doesn't show a banner neither ...

Just some clarification.
To use Firebase+Admob+Analytics, in C++ with no cocoapods.

I need  [A] because it contains the C++ layer & headers.
then [B] to have the analytics frameworks.
But the admob framework, can come either from B, or from C, right ? And not from both !
If so, what is the version of AdMob included in B?

So, it seems to me I can do either use :
1) A, B. But no C
or
2) A, B without the Admob Framework, C

Thanks,
Cheers

Stewart Miles

unread,
Jun 1, 2016, 11:38:53 AM6/1/16
to fireba...@googlegroups.com, Andrew Brogdon, Tristan Emrich
We built and tested AdMob with Firebase against 7.8.1.

On Wed, Jun 1, 2016 at 3:21 AM, syl <tactica...@gmail.com> wrote:
hi Jon,

Thanks for you precisions ! I added libz and libsqlite3, plus using libc++. It seems to work a little better now !

I have the version 7.8.1 but I got another issue with it (already reported), so currently I'm stuck.
For the moment, I down-graded to admob 7.7.0.
Don't know if Firebase can work with admob 7.7.0 ?

+admob devrel for guidance here.
 
So far, all (firebase, admob, analytics) can be initialized with no crash, but it doesn't show a banner neither ...


Do you have any sample code that demonstrates this behavior?  If you can't share could you try to reproduce using the Firebase AdMob C++ sample? https://github.com/firebase/quickstart-cpp/tree/master/admob/testapp by default we describe the setup using Cocoapods but you could just use the frameworks directly instead.
 

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/1f965399-06c5-4021-ba83-44e24a1785c3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

syl

unread,
Jun 2, 2016, 4:31:19 AM6/2/16
to Firebase Google Group, redbr...@google.com, tris...@google.com
I have sent a message to Veer to get test sample.
It would be possible to start firebase with this. (but the sample is quite incomplete right now).

The fact that it crashes with Firebase Cpp + AdMob 7.8.1 is more related to AdMob itself I guess (and Veer is looking at it).

The fact that the banner is not shown with Firebase Cpp + AdMob 7.7.0 :
- check maybe whether this should be work or not, before doing anything with my testcase...
Reply all
Reply to author
Forward
0 new messages