Giter Club home page Giter Club logo

firebase / quickstart-cpp Goto Github PK

View Code? Open in Web Editor NEW
203.0 82.0 120.0 7.64 MB

Firebase Quickstart Samples for C++

Home Page: https://firebase.google.com/games

License: Apache License 2.0

Ruby 0.38% C++ 64.69% Objective-C++ 8.31% C 3.41% Java 5.43% CMake 8.22% JavaScript 0.30% Shell 0.49% Python 8.77%
cpp firebase firebase-auth firebase-database firebase-analytics firebase-cloud-messaging firebase-storage admob firebase-appinvites firebase-remote-config

quickstart-cpp's Introduction

Firebase C++ Samples

iOS and Android samples for the Firebase C++ SDK.

For more information, see firebase.google.com.

Issue reporting

This repo no longer accepts issue reporting. For Firebase C++ SDK related issues, please report to Firebase C++ Open-source. Please fill in the template to expedite the support.

How to make contributions?

Please read and follow the steps in CONTRIBUTING.md.

License

See LICENSE.

quickstart-cpp's People

Contributors

a-maurice avatar chkuang-g avatar dellabitta avatar ehsannas avatar jonsimantov avatar keyboardsurfer avatar kiranchhetri1 avatar kokoro-team avatar mark-grimes avatar mkow avatar morganchen12 avatar samtstern avatar vimanyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quickstart-cpp's Issues

OnMessage not fired when app is in background - IOS

Hi,
Firebase C++ is working great on Android, but I'm facing some issues with IOS.
I'm sending a data message to one iOS Device like this:

{
	"to":"mykey",
	"data":{
		"title": "hello",
    	        "body": "this is body",		
		"key1":"value1",
		"key2":"value2",
		"message":"message X"
	},
	"priority":"high"
}

The message above fires the C++ OnMessage when the iOS app is in foreground, but it's not received when it's in background.
Any ideas on how to make it work and also display a notification when a message is received in background?

Here's my AppDelegate.m:

@interface QIOSApplicationDelegate
@end
//! Add a category to QIOSApplicationDelegate
@interface QIOSApplicationDelegate (QFacebookApplicationDelegate) //<UNUserNotificationCenterDelegate>
@end
NSString *const kGCMMessageIDKey = @"gcm.message_id";
@implementation QIOSApplicationDelegate (QFacebookApplicationDelegate)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
	// Override point for customization after application launch.
	NSLog( @"Firebase configured.==============================================" );
    [FIRApp configure];
    
    // [START set_messaging_delegate]
    [FIRMessaging messaging].delegate = self;
    // [END set_messaging_delegate]
    
    // Register for remote notifications. This shows a permission dialog on first run, to
    // show the dialog at a more appropriate time move this registration accordingly.
    // [START register_for_notifications]
    if ([UNUserNotificationCenter class] != nil) {
        // iOS 10 or later
        // For iOS 10 display notification (sent via APNS)
        [UNUserNotificationCenter currentNotificationCenter].delegate = self;
        UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert |
        UNAuthorizationOptionSound | UNAuthorizationOptionBadge;
        [[UNUserNotificationCenter currentNotificationCenter]
         requestAuthorizationWithOptions:authOptions
         completionHandler:^(BOOL granted, NSError * _Nullable error) {
             // ...
         }];
    } else {
        // iOS 10 notifications aren't available; fall back to iOS 8-9 notifications.
        UIUserNotificationType allNotificationTypes =
        (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
        UIUserNotificationSettings *settings =
        [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
        [application registerUserNotificationSettings:settings];
    }
    
    [application registerForRemoteNotifications];
    // [END register_for_notifications]
	return YES;
}
@end

I'm using Firebase CPP 5.4.4
Thank you,
Bruno.

Android FCM not waking up

Hi team,
I'm using Firebase C++ SDK quick start messaging to get familiar with Android FCM. After I set up completely, Although I can receive notifications from server, quick start messaging app did not wake up. How can I solve this problem. Thanks.

Platform: Android (built by MAC OS)
Device: Samsung J7
Firebase C++ SDK version: 6.8

Project is some update needs. (gradle.properties, AndroidMnifest.xml, google-services.json)

Please fill in the following fields:

  • macOS Catalina : 10.15.6
  • Android Studio : v4.0.1
  • Firebase C++ SDK version : v6.15.1
  • Firebase plugins in use : admob
  • Platform you are targeting Android (Simulator)

Please describe the issue here:

Please answer the following, if applicable:

  • Have you been able to reproduce this issue with just the Firebase C++ quickstarts (this GitHub project)?

    • -> YES
  • What's the issue repro rate? (eg 100%, 1/5 etc)

    • -> 100%

Crash on Android

I'm getting this on Android after (unknown) amount of requests have been made

E/dalvikvm(19482): JNI ERROR (app bug): local reference table overflow (max=1024)
W/dalvikvm(19482): JNI local reference table (0x74ebeb78) dump:
W/dalvikvm(19482):   Last 10 entries (of 1024):
W/dalvikvm(19482):      1023: 0x4125e880 com.google.android.gms.ads.AdRequest$Builder
W/dalvikvm(19482):      1022: 0x4125ed90 com.google.android.gms.ads.AdRequest
W/dalvikvm(19482):      1021: 0x4125e880 com.google.android.gms.ads.AdRequest$Builder
W/dalvikvm(19482):      1020: 0x4125eb88 com.google.firebase.admob.internal.cpp.AdRequestHelper
W/dalvikvm(19482):      1019: 0x4125e880 com.google.android.gms.ads.AdRequest$Builder
W/dalvikvm(19482):      1018: 0x4125e880 com.google.android.gms.ads.AdRequest$Builder
W/dalvikvm(19482):      1017: 0x4125e880 com.google.android.gms.ads.AdRequest$Builder
W/dalvikvm(19482):      1016: 0x412ca608 com.google.android.gms.ads.AdRequest$Builder
W/dalvikvm(19482):      1015: 0x412c4110 com.google.android.gms.ads.AdRequest
W/dalvikvm(19482):      1014: 0x412ca608 com.google.android.gms.ads.AdRequest$Builder
W/dalvikvm(19482):   Summary:
W/dalvikvm(19482):         1 of java.lang.Class
W/dalvikvm(19482):       146 of com.google.android.gms.ads.AdRequest (146 unique instances)
W/dalvikvm(19482):       730 of com.google.android.gms.ads.AdRequest$Builder (146 unique instances)
W/dalvikvm(19482):       146 of com.google.firebase.admob.internal.cpp.AdRequestHelper (146 unique instances)
W/dalvikvm(19482):         1 of com.google.firebase.admob.internal.cpp.InterstitialAdHelper
E/dalvikvm(19482): Failed adding to JNI local ref table (has 1024 entries)

MismatchSenderId no matter what I try

Hi there

Thanks a lot for the quickstart-cpp project. I am using the 2.1.0 version and I managed to include it in my cross platform project in no time at all. I am currently testing it for iOS but no matter what I do, I end up with this type of response:
{"multicast_id":6116168930780731961,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MismatchSenderId"}]}

Sending from the Firebase console to the registration_id of the device also does not work. I have debugged what I could and it looks correct. The content of the AppOptions is assigned from the plist file and it looks correct. Firebase initializes ok and I get the registration token in the onTokenReceived callback.

I have tried various times to delete and reinstall the app and I get a new registration token which I test but it simply never works, neither sending a notification from the console or using curl.

I have spend almost two days, trying anything I could find on SO and I am all out of idea so any suggestion is highly appreciated. It does not seems that complex but still I can not get pass the MismatchSenderId and I do not know how to troubleshoot further.

[Admob] IOS : Error while loading a rewarded video ad

Hello team,

I'm trying to using the Admob tutorial. Unfortunately I always get the error while loading the rewarded video ads.

The log I got like:

2019-12-05 11:13:07.176988+0700 testapp[462:43948] Initializing rewarded video.
2019-12-05 11:13:08.177713+0700 testapp[462:43948] Setting rewarded video listener.
2019-12-05 11:13:08.177999+0700 testapp[462:43948] Loading a rewarded video ad.
2019-12-05 11:13:27.262124+0700 testapp[462:43948] ERROR: Action failed with error code 4 and message "An internal SDK error occurred.".
2019-12-05 11:13:27.262865+0700 testapp[462:43948] Done!
2019-12-05 11:16:46.051925+0700 testapp[462:44341] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C3.1:2][0x1060379d0] get output frames failed, state 8196

I'm using:

  • firebase_cpp_sdk_6.7.0, universal IOS framework
  • Pod : 'Firebase/Analytics', '6.12.0' ; 'Firebase/AdMob', '6.12.0'
  • Our AdMobAppID
  • RewardedVideoAdUnit test : "ca-app-pub-3940256099942544/6386090517"

You can find for the full console log in here : IOS_Error_RewardedVideo_log.txt

Could you help me to take a look and show me how to overcome this error?

[Desktop]Test FCM does not receive data

I have used "Compose notification" to check but didn't receive a notification from firebase and didn't have any other information.
Operating system: linux(gentoo)
Operating system version: gcc version 7.3.0,cmake version 3.13.2
C++ SDK: 5.4.4
I'm not sure if I'm wrong or missing something, looking forward to helping!

Firebase App initializing app __FIRAPP_DEFAULT (default 1).
Initialized Firebase App.
Initialize the Messaging library
Try to initialize Firebase Messaging
Initialized Firebase Cloud Messaging.
Display permission prompt if necessary.
Finished checking for permission.
::firebase::messaging::Subscribe("TestTopic")...
::firebase::messaging::Subscribe("TestTopic") completed as expected
::firebase::messaging::Subscribe("!@#$%^&()")...
ERROR: ::firebase::messaging::Subscribe("!@#$%^&
()") completed with error: 0, Successfully completed as a stub.

firebase c++ sdk on android firebase::app::create with AppOption return NULL

I create sdk firebase c++ on Android, I use the google_service.json configuration file when everything is fine, but when I use :: firebase :: AppOption to configure then it returns NULL, please tell me I made a mistake where, thanks you so much

::firebase::App *app;
::firebase::AppOptions appOptions;
appOptions = firebase::AppOptions();

const char *api_key = "";
const char *app_id = "";
const char *database_url = "";
const char *messaging_sender_id = "";
const char *project_id = "";
const char *storage_bucket = "";
appOptions.set_api_key(api_key);
appOptions.set_app_id(app_id);
appOptions.set_database_url(database_url);
appOptions.set_messaging_sender_id(messaging_sender_id);
appOptions.set_project_id(project_id);
appOptions.set_storage_bucket(storage_bucket);

app = ::firebase::App::Create(appOptions, app_id, jni_env, activity); // result NULL

Firebase C++ SDK on Android Crashes with SIGSEGV fault addr 0x0 when creating dynamic link

We're using the Firebase C++ SDK for our iOS and Android game. On iOS creating dynamic links works just perfectly, but on Android we're getting crashes which we can't resolve even after countless hours of trying various things.

Here's the code that causes the crash:

   std::string appBundleId = getAppBundleIdentifier();

   firebase::dynamic_links::IOSParameters ios_parameters(appBundleId.c_str());

   firebase::dynamic_links::AndroidParameters android_parameters(appBundleId.c_str());

   firebase::dynamic_links::DynamicLinkComponents components(
           "https://example.com/", "abc123.app.goo.gl");
   components.android_parameters = &android_parameters;
   components.ios_parameters = &ios_parameters;

   // This log shows that the app is not nullptr
   MLLOG("Firebase Instance %s", firebase::App::GetInstance()->name());

   // The next line crashes
   firebase::dynamic_links::GeneratedDynamicLink longLink = firebase::dynamic_links::GetLongLink(components);

Here's the stacktrace, we obtained via adb logcat:

********** Crash dump: **********
Build fingerprint: 'samsung/kccat6xx/kccat6:6.0.1/MMB29M/G901FXXS1CPI4:user/release-keys'
pid: 22798, tid: 23065, name: GLThread 19076  >>> com.forestringgames.apps.towerduel <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Stack frame #00 pc 0416bed4  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN8firebase3App11GetInstanceEPKc+3)
Stack frame #01 pc 041620bf  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN8firebase13dynamic_links11GetLongLinkERKNS0_21DynamicLinkComponentsE+38)
Stack frame #02 pc 0306eb6f  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN15PlatformManager29createDynamicReferralLinkLongEv+226)
Stack frame #03 pc 0260a11f  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so
Stack frame #04 pc 0260b307  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so
Stack frame #05 pc 041c6df0  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZNKSt8functionIFvPN7cocos2d3RefEEEclES2_+88)
Stack frame #06 pc 0430ce50  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d8MenuItem8activateEv+80)
Stack frame #07 pc 0430d908  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d13MenuItemLabel8activateEv+92)
Stack frame #08 pc 04308df4  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d4Menu12onTouchEndedEPNS_5TouchEPNS_5EventE+196)
Stack frame #09 pc 0430c3f8  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZNKSt7_Mem_fnIMN7cocos2d4MenuEFvPNS0_5TouchEPNS0_5EventEEEclIJS3_S5_EvEEvPS1_DpOT_+172)
Stack frame #10 pc 0430c1fc  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZNSt5_BindIFSt7_Mem_fnIMN7cocos2d4MenuEFvPNS1_5TouchEPNS1_5EventEEEPS2_St12_PlaceholderILi1EESB_ILi2EEEE6__callIvJOS4_OS6_EJLj0ELj1ELj2EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+200)
Stack frame #11 pc 0430be34  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZNSt5_BindIFSt7_Mem_fnIMN7cocos2d4MenuEFvPNS1_5TouchEPNS1_5EventEEEPS2_St12_PlaceholderILi1EESB_ILi2EEEEclIJS4_S6_EvEET0_DpOT_+104)
Stack frame #12 pc 0430ba68  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZNSt17_Function_handlerIFvPN7cocos2d5TouchEPNS0_5EventEESt5_BindIFSt7_Mem_fnIMNS0_4MenuEFvS2_S4_EEPS8_St12_PlaceholderILi1EESD_ILi2EEEEE9_M_invokeERKSt9_Any_dataS2_S4_+80)
Stack frame #13 pc 025e613d  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZNKSt8functionIFvPN7cocos2d5TouchEPNS0_5EventEEEclES2_S4_+68)
Stack frame #14 pc 043de15c  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so
Stack frame #15 pc 043e5a08  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so
Stack frame #16 pc 043e1f64  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZNKSt8functionIFbPN7cocos2d13EventListenerEEEclES2_+88)
Stack frame #17 pc 043dd850  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d15EventDispatcher29dispatchTouchEventToListenersEPNS0_19EventListenerVectorERKSt8functionIFbPNS_13EventListenerEEE+1128)
Stack frame #18 pc 043de8c8  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d15EventDispatcher18dispatchTouchEventEPNS_10EventTouchE+552)
Stack frame #19 pc 043ddb90  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d15EventDispatcher13dispatchEventEPNS_5EventE+156)
Stack frame #20 pc 0438dc50  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d6GLView26handleTouchesOfEndOrCancelENS_10EventTouch9EventCodeEiPiPfS4_+732)
Stack frame #21 pc 0438dd88  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (_ZN7cocos2d6GLView16handleTouchesEndEiPiPfS2_+60)
Stack frame #22 pc 041469e1  /data/app/com.forestringgames.apps.towerduel-2/lib/arm/libcocos2dcpp.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesEnd+68)
Stack frame #23 pc 01096e41  /data/app/com.forestringgames.apps.towerduel-2/oat/arm/base.odex (offset 0xaa1000) (void org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(int, float, float)+100)
Stack frame #24 pc 010971e3  /data/app/com.forestringgames.apps.towerduel-2/oat/arm/base.odex (offset 0xaa1000) (void org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(int, float, float)+70)
Stack frame #25 pc 010841a7  /data/app/com.forestringgames.apps.towerduel-2/oat/arm/base.odex (offset 0xaa1000) (void org.cocos2dx.lib.Cocos2dxGLSurfaceView$10.run()+170)
Stack frame #26 pc 03e4cd8d  /system/framework/arm/boot.oat (offset 0x2f48000)

Just in case this could be part of the problem, our firebase app seems to create successfully - we do it via a native call from onCreate:

JNIEXPORT void JNICALL Java_org_cocos2dx_cpp_AppActivity_onCreate(JNIEnv* env, jclass, jobject aMainActivity)
{
    MLLOG("java_org_cocos2dx_cpp_AppActivity_onCreate called");
     firebase::AppOptions appOptions;
    _firebaseApp = firebase::App::Create(appOptions, env, aMainActivity);
    auto app = firebase::App::GetInstance();

    // Both log the same pointer here
    MLLOG("FIREBASE APP INIT %p AppGetInstance %p", _firebaseApp, app);
}

Messaging doesn't emit onMessage when App is in background and comes to forground

Hello i found one more bug in the messaging SDK.
I think this is a library issue but i dont know where to post it. So lets try here.

So on android when i start the app from a notification the onMessage function is emited fine.
When the app is running the onMessage function is emited fine too.
But when the app is in the background and i tap on a notification, the app comes to forground, but dosent emits the onMessage function. There is nothing happening.
Is this mybe a bug in the messaging library?

Add build verification using GitHub Actions

Since this repository is used for snippets that are included in docs, the code here should have some automated verification that it compiles. Travis CI would be ideal as it's consistent with other Firebase Github projects.

Unit testing is not required but is a nice-to-have.

CocoaPods missing libraries present in the Firebase iOS download zip

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.

I am stuck here help me please

[READ] For Firebase C++ SDK issues, please report to Firebase C++ open-source

Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Please fill in the following fields:

  • Which Firebase Sample: _____ (Auth, Database, etc.)
  • Firebase C++ SDK version: _____
  • Additional SDKs you are using: _____ (Facebook, AdMob, etc.)
  • Platform you are using the SDK on: _____ (Mac, Windows, or Linux)
  • Platform you are targeting: _____ (iOS, Android, and/or desktop)

[REQUIRED] Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, and stack traces if available.)

Steps to reproduce:

What's the issue repro rate? (eg 100%, 1/5 etc)

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Updating Firebase to latest throws `undefined reference`

NDK Version: r17b
Firebase SDK: 5.2.0

Error message:

/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:131: error: undefined reference to 'firebase::invites::internal::InvitesReceiverInternal::CreateInstance(firebase::App const&, firebase::invites::internal::ReceiverInterface*)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:52: error: undefined reference to 'firebase::invites::internal::CachedReceiver::CachedReceiver()'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:177: error: undefined reference to 'firebase::invites::internal::InvitesReceiverInternal::DestroyInstance(firebase::invites::internal::InvitesReceiverInternal*, firebase::invites::internal::ReceiverInterface*)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:301: error: undefined reference to 'firebase::invites::internal::InvitesReceiverInternal::Fetch()'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:62: error: undefined reference to 'firebase::invites::internal::CachedReceiver::SetReceiver(firebase::invites::internal::ReceiverInterface*)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:290: error: undefined reference to 'firebase::invites::internal::InvitesReceiverInternal::ConvertInvitation(char const*)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:295: error: undefined reference to 'firebase::invites::internal::InvitesReceiverInternal::ConvertInvitationLastResult()'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:53: error: undefined reference to 'firebase::invites::internal::CachedReceiver::~CachedReceiver()'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:53: error: undefined reference to 'firebase::invites::internal::CachedReceiver::~CachedReceiver()'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/common/invites.cc:92: error: undefined reference to 'firebase::invites::internal::CachedReceiver::ReceivedInviteCallback(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, firebase::invites::internal::InternalLinkMatchStrength, int, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/android/invites_sender_internal_android.cc:39: error: undefined reference to 'firebase::invites::internal::AndroidHelper::AndroidHelper(firebase::App const&, firebase::invites::internal::SenderReceiverInterface*)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/android/invites_sender_internal_android.cc:44: error: undefined reference to 'firebase::invites::internal::AndroidHelper::CallMethod(firebase::invites::internal::invite::Method)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/android/invites_sender_internal_android.cc:46: error: undefined reference to 'firebase::invites::internal::AndroidHelper::CallMethodStringString(firebase::invites::internal::invite::Method, char const*, char const*)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/android/invites_sender_internal_android.cc:51: error: undefined reference to 'firebase::invites::internal::AndroidHelper::CallMethod(firebase::invites::internal::invite::Method)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/android/invites_sender_internal_android.cc:54: error: undefined reference to 'firebase::invites::internal::AndroidHelper::CallMethodStringString(firebase::invites::internal::invite::Method, char const*, char const*)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/android/invites_sender_internal_android.cc:58: error: undefined reference to 'firebase::invites::internal::AndroidHelper::CallBooleanMethod(firebase::invites::internal::invite::Method)'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/android/invites_sender_internal_android.h:20: error: undefined reference to 'firebase::invites::internal::AndroidHelper::~AndroidHelper()'
/tmpfs/src/gfile/kokoro_invitesandroid/firebase/invites/client/cpp/src/android/invites_sender_internal_android.h:20: error: undefined reference to 'firebase::invites::internal::AndroidHelper::~AndroidHelper()'

transaction crash

run the database sample,
I add one line code, inside the transaction function

int childCount = (int)data->children_count();

then the sample crash:
JNI DETECTED ERROR IN APPLICATION: the return type of CallIntMethodV does not match long com.google.firebase.database.MutableData.getChildrenCount()

Dynamic Links on Android with C++ SDK only received if App not started previously

We've setup dynamic link creation both on iOS and Android with the Firebase Dynamic Link C++ SDK. All is working perfectly fine on iOS, links get received and the Listener is triggered whether the App is closed before or not. This is our Listener code:

void PlatformManager::OnDynamicLinkReceived(const firebase::dynamic_links::DynamicLink *dynamic_link)
{
        MLLOG("[PlatformManager] OnDynamicLinkReceived - Received link: %s", dynamic_link->url.c_str());
}

App Init:

#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
       
    firebase::AppOptions appOptions;
    _firebaseApp = firebase::App::Create(appOptions);

#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID

    firebase::AppOptions appOptions;
    _firebaseApp = firebase::App::Create(firebase::AppOptions(), JniHelper::getEnv(), JniHelper::getActivity());

#endif

    firebase::dynamic_links::Initialize(*_firebaseApp, this);

Also our manifest setup:

        <activity
            android:name="org.cocos2dx.cpp.AppActivity"
            android:screenOrientation="sensorPortrait"
            android:configChanges="orientation|screenSize|keyboardHidden"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:host="towerduel.com" android:scheme="http"/>
                <data android:host="towerduel.com" android:scheme="https"/>
            </intent-filter>
        </activity>

On Android, the log is only triggered when the App was not open previously. If the App was open, then clicking the Link also does correctly open the App, but the listener is not triggered / no log ist printed.

Do you have any idea why this is happening and how we can also make the listener trigger if the app is already open like on iOS?

An internal error has occurred

I have tried running auth example. The code is built successfully but when I execute "desktop_testapp" I get the following errors:

Starting Auth tests.
Firebase App initializing app __FIRAPP_DEFAULT (default 1).
Created the Firebase app 16d09c0.
Created the Auth 16d33a0 class for the Firebase app.
No user signed in at creation time.
AuthStateListener called 0 times on registration.
IdTokenListener called 0 times on registration.
AuthStateListener called 0 times on SignOut() when already signed-out.
IdTokenListener called 0 times on SignOut() when already signed-out.
Calling Auth::SignInAnonymously()...
ERROR: Auth::SignInAnonymously() completed with error: 1, An internal error has occurred.
ERROR: AuthStateListener called 0 times on SignInAnonymously().
ERROR: IdTokenListener called 0 times on SignInAnonymously().
Current user (nil)
ERROR: AuthStateListener called 0 times on SignOut().
ERROR: IdTokenListener called 0 times on SignOut().
Current user (nil)
Calling CreateUserWithEmailAndPassword() to create temp user...
ERROR: CreateUserWithEmailAndPassword() to create temp user completed with error: 1, An internal error has occurred.
ERROR: Could not register new user.
Calling Auth::SignInAnonymously() for User...
ERROR: Auth::SignInAnonymously() for User completed with error: 1, An internal error has occurred.
Calling Auth::CreateUserWithEmailAndPassword() new email for delete...
ERROR: Auth::CreateUserWithEmailAndPassword() new email for delete completed with error: 1, An internal error has occurred.
Calling Auth::SignInAnonymously() at end...
ERROR: Auth::SignInAnonymously() at end completed with error: 1, An internal error has occurred.
Completed Auth tests.

I have set the correct path to Firebase C++ SDK and also the file "google-services.json" is copied in the "testapp" directory.

Regards,

Danesh Daroui

Compiler errors switching from GCC to Clang

So I have a Qt project in which I incorporated Firebase C++ using the wrapper here https://github.com/Larpon/QtFirebase. I decided to switch my compiler from GCC (which was working ok) to Clang as Google deprecated the former, but now I am getting these strange errors:

/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:555: error: undefined reference to 'std::string::assign(std::string const&)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/variant.cc:242: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/variant.cc:293: error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:282: error: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:282: error: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/variant.cc:359: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:555: error: undefined reference to 'std::string::assign(std::string const&)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/variant.cc:370: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:555: error: undefined reference to 'std::string::assign(std::string const&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:555: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/variant.cc:386: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:282: error: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:282: error: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/include/firebase/app.h:93: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/app_android.cc:273: error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:555: error: undefined reference to 'std::string::assign(std::string const&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:1149: error: undefined reference to 'std::string::assign(char const*, unsigned int)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/include/firebase/app.h:93: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/include/firebase/app.h:93: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/include/firebase/app.h:93: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/include/firebase/app.h:93: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:1149: error: undefined reference to 'std::string::assign(char const*, unsigned int)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:1149: error: undefined reference to 'std::string::assign(char const*, unsigned int)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:1149: error: undefined reference to 'std::string::assign(char const*, unsigned int)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/util_android.cc:843: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/util_android.cc:840: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/util_android.cc:847: error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/util_android.cc:797: error: undefined reference to 'std::string::_Rep::_S_empty_rep_storage'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/vector.tcc:69: error: undefined reference to 'std::__throw_length_error(char const*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/vector.tcc:69: error: undefined reference to 'std::__throw_length_error(char const*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:1689: error: undefined reference to 'std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:1697: error: undefined reference to 'std::__detail::_List_node_base::_M_unhook()'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:1697: error: undefined reference to 'std::__detail::_List_node_base::_M_unhook()'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:2442: error: undefined reference to 'std::string::append(unsigned int, char)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:2468: error: undefined reference to 'std::string::append(std::string const&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:1252: error: undefined reference to 'std::string::insert(unsigned int, std::string const&, unsigned int, unsigned int)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:950: error: undefined reference to 'std::string::append(std::string const&)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/util_android.cc:1635: error: undefined reference to 'std::string::push_back(char)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:1426: error: undefined reference to 'std::string::erase(unsigned int, unsigned int)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_vector.h:1585: error: undefined reference to 'std::__throw_length_error(char const*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_vector.h:1585: error: undefined reference to 'std::__throw_length_error(char const*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:218: error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1175: error: undefined reference to 'std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:218: error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1175: error: undefined reference to 'std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:218: error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:203: error: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1726: error: undefined reference to 'std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:218: error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:203: error: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1894: error: undefined reference to 'std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:203: error: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:814: error: undefined reference to 'std::string::_M_mutate(unsigned int, unsigned int, unsigned int)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:1026: error: undefined reference to 'std::string::append(char const*, unsigned int)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:2451: error: undefined reference to 'std::string::append(std::string const&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:1026: error: undefined reference to 'std::string::append(char const*, unsigned int)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:950: error: undefined reference to 'std::string::append(std::string const&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:203: error: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
/tmpfs/src/gfile/kokoro_appandroid/firebase/app/client/cpp/src/app_common.cc:182: error: undefined reference to 'std::string::substr(unsigned int, unsigned int) const'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:592: error: undefined reference to 'std::string::swap(std::string&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:814: error: undefined reference to 'std::string::_M_mutate(unsigned int, unsigned int, unsigned int)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:814: error: undefined reference to 'std::string::_M_mutate(unsigned int, unsigned int, unsigned int)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1726: error: undefined reference to 'std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1894: error: undefined reference to 'std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:1697: error: undefined reference to 'std::__detail::_List_node_base::_M_unhook()'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:1689: error: undefined reference to 'std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_list.h:1697: error: undefined reference to 'std::__detail::_List_node_base::_M_unhook()'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1894: error: undefined reference to 'std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_tree.h:1894: error: undefined reference to 'std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
/opt/android-sdk/current/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/functional:2438: error: undefined reference to 'std::__throw_bad_function_call()'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

I have tried to add this in my build.gradle but it doesn't work:

    ndk{
        toolchain = "clang"

        moduleName = "example"

        stl = "c++_static"

        cppFlags.add("-std=c++11")
        cppFlags.add("-fexceptions")
        cppFlags.add("-frtti")
        cppFlags.add("-latomic")
        ldFlags.add("-latomic")
    }

Undefined symbol: firebase::ReferenceCountedFutureImpl::ReleaseMutexAndRunCallback(unsigned long)

d: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/gamedepartment/Desktop/IOS Builds/JigsawTest5/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
Undefined symbols for architecture arm64:
"firebase::ReferenceCountedFutureImpl::ReleaseMutexAndRunCallback(unsigned long)", referenced from:
void firebase::ReferenceCountedFutureImpl::CompleteInternal<void, void firebase::ReferenceCountedFutureImpl::CompleteInternal(unsigned long, int, char const*)::'lambda'(void*)>(unsigned long, int, char const*, void firebase::ReferenceCountedFutureImpl::CompleteInternal(unsigned long, int, char const*)::'lambda'(void*) const&) in libStorage.a(storage_reference_ios_54a917f3a4ebcc04d14981a81202a365.o)
void firebase::ReferenceCountedFutureImpl::CompleteInternal<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, void firebase::ReferenceCountedFutureImpl::CompleteWithResultInternal<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >(unsigned long, int, char const*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)::'lambda'(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >)>(unsigned long, int, char const, void firebase::ReferenceCountedFutureImpl::CompleteWithResultInternal<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >(unsigned long, int, char const*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)::'lambda'(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) const&) in libStorage.a(storage_reference_ios_54a917f3a4ebcc04d14981a81202a365.o)
void firebase::ReferenceCountedFutureImpl::CompleteInternal<void, void firebase::ReferenceCountedFutureImpl::CompleteInternal<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >(unsigned long, int, char const
)::'lambda'(void*)>(unsigned long, int, char const*, void firebase::ReferenceCountedFutureImpl::CompleteInternal<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >(unsigned long, int, char const*)::'lambda'(void*) const&) in libStorage.a(storage_reference_ios_54a917f3a4ebcc04d14981a81202a365.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Screenshot 2020-01-17 at 10 15 02 AM

Crash when using remote_config::SetDefaults

I'm using the latest version 4.1.0

When using:
remote_config::SetDefaults(defaults.get(), filteredMap.size());

I get a crash on iOS:

2017-08-28 12:53:32.866634+0200 App[675:250041] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: key cannot be nil'

*** First throw call stack:

(0x188e5afe0 0x1878bc538 0x188d3e528 0x100215bf8 0x10006340c 0x100062654 0x100073cd0 0x100074444 0x10174b930 0x100f05838 0x100e30ad8 0x100e2f844 0x100e2f448 0x100e2ef58 0x100e91c0c 0x100e4cd18 0x100e4621c 0x100e4abd0 0x100d7762c 0x100f32680 0x100e9d810 0x100e9de1c 0x100f0d42c 0x100e65f00 0x101789838 0x10178975c 0x100074168 0x100060910 0x100061f9c 0x10005fe28 0x100064728 0x100064620 0x100064514 0x10178d0d0 0x10178a070 0x10178975c 0x10006e9c8 0x100045484 0x100047908 0x100047820 0x1000476cc 0x10178d0d0 0x10178a070 0x10178975c 0x10179b580 0x10179b51c 0x101782ed4 0x101742368 0x101741f28 0x101741f9c 0x100ff8720 0x101741e28 0x1002f8920 0x1017d6da8 0x10181e1c8 0x10181ea60 0x188e09aa4 0x188e097a8 0x188e09068 0x188e06c8c 0x188d36da4 0x18a7a1074 0x18eff1c9c 0x1002d1f4c 0x187d4559c)

libc++abi.dylib: terminating with uncaught exception of type NSException

I'm guessing that something unexpected gets passed in remote_config::SetDefaults(); but the same code runs flawlessly on Android?

without cocoapods

Hi - I'm trying to get a firebase CPP database example running without using cocoapods since I am using Qt CPP. I tried to manually specify the frameworks in the Qt .pro file as

ios {
    QMAKE_LFLAGS += F/Users/me/Documents/firebase_cpp_sdk/libs/frameworks/universal
    LIBS += -framework firebase
    LIBS += -framework firebase_auth
    LIBS += -framework firebase_database
    QMAKE_INFO_PLIST = ios/Project-Info.plist
    OTHER_FILES += $$QMAKE_INFO_PLIST
    OTHER_FILES += google-services.json
}

but get link errors

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_FIRApp", referenced from:
      objc-class-ref in firebase(app_ios_0d9822969971d805b6c1fe1da95ac6eb.o)
  "_OBJC_CLASS_$_FIRAuth", referenced from:
      objc-class-ref in firebase_auth(auth_ios_f2d260118c71437a29dfd0bb1f84c2b2.o)
  "_OBJC_CLASS_$_FIRDatabase", referenced from:
      objc-class-ref in firebase_database(database_ios_d4065f07727b6295b21f7f78e32ac829.o)
  "_OBJC_CLASS_$_FIRDatabaseReference", referenced from:
      objc-class-ref in firebase_database(database_reference_ios_01d57dacac0312e7ded1b059f0eb08d5.o)
  "_OBJC_CLASS_$_FIROptions", referenced from:
      objc-class-ref in firebase(app_ios_0d9822969971d805b6c1fe1da95ac6eb.o)
  "_OBJC_CLASS_$_FIRTransactionResult", referenced from:
      objc-class-ref in firebase_database(database_reference_ios_01d57dacac0312e7ded1b059f0eb08d5.o)
ld: symbol(s) not found for architecture x86_64

How do I successfully link? Many thanks

Where did the Message come from?

Is there a way to figure out where the message did come from?
Lets say the app is in the background and user clicks on the notification.
Or the app is not in the background (closed) and the user clicks on the notification.
Or the app is the forground (opend) and we get a notification.

There is no way to figure out whre the message did come from.
Is there mybe a way to figure out if the message we are reciving in c++ is coming from
background, forground or closed app status?

It would be grait if there would be a property in the message.notification data where
we could check where the notification did come from.

Or am i missing something here?

Regrads Isy

Building test app fails on Windows MSVC 16 2019

  • Which Firebase Sample: Remote Config
  • Firebase C++ SDK version: 11.0.3
  • Additional SDKs you are using: Nothing
  • Platform you are using the SDK on: Windows
  • Platform you are targeting: Desktop

The issue happens every time I build project using Cmake

When I try to build test application using prebuilt binaries from here, there happen some weird compiler errors, listed here:
firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_cleanup_notifier.obj) : error LNK2019: unresol ved external symbol __std_find_trivial_8 referenced in function "void * * __cdecl __std_find_trivial<void *,unsigned __ int64>(void * *,void * *,unsigned __int64)" (??$__std_find_trivial@PEAX_K@@YAPEAPEAXPEAPEAX0_K@Z) [C:\Users\Sasha\Docum ents\projects2021\github-garbage-folder\firebase-test-app\desktop_testapp.vcxproj] firebase_app.lib(d3d7d08a438878e74aeb2cbaaedfc967_flatbuffers.dir_Debug_idl_parser.obj) : error LNK2001: unresolved ext ernal symbol __std_find_trivial_8 [C:\Users\Sasha\Documents\projects2021\github-garbage-folder\firebase-test-app\deskto p_testapp.vcxproj] firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_locale.obj) : error LNK2019: unresolved extern al symbol u_errorName referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::all ocator<char> > __cdecl firebase::internal::GetTimezone(void)" (?GetTimezone@internal@firebase@@YA?AV?$basic_string@DU?$ char_traits@D@std@@V?$allocator@D@2@@std@@XZ) [C:\Users\Sasha\Documents\projects2021\github-garbage-folder\firebase-tes t-app\desktop_testapp.vcxproj] firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_locale.obj) : error LNK2019: unresolved extern al symbol ucal_getTimeZoneIDForWindowsID referenced in function "class std::basic_string<char,struct std::char_traits<c har>,class std::allocator<char> > __cdecl firebase::internal::GetTimezone(void)" (?GetTimezone@internal@firebase@@YA?AV ?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) [C:\Users\Sasha\Documents\projects2021\github-garbage- folder\firebase-test-app\desktop_testapp.vcxproj] firebase_app.lib(d94e1bff3c0e8414a6679ea91c3e103e_firebase_app.dir_Debug_heartbeat_storage_desktop.obj) : error LNK2019 : unresolved external symbol __std_find_trivial_1 referenced in function "char const * __cdecl __std_find_trivial<char const ,unsigned char>(char const *,char const *,unsigned char)" (??$__std_find_trivial@$$CBDE@@YAPEBDPEBD0E@Z) [C:\User s\Sasha\Documents\projects2021\github-garbage-folder\firebase-test-app\desktop_testapp.vcxproj] C:\Users\Sasha\Documents\projects2021\github-garbage-folder\firebase-test-app\Debug\desktop_testapp.exe : fatal error L NK1120: 4 unresolved externals [C:\Users\Sasha\Documents\projects2021\github-garbage-folder\firebase-test-app\desktop_t estapp.vcxproj]

Steps to reproduce:

cmake .
cmake --build .

ios notification_opened dosen´t work when app is in background

Hello together,
i found a bug in firebase messaging.
The notification_opened property dosen´t work on ios when the app is in the background.
It work fine when the app is closed and was started from a tap to the notification.

On Android it work fine when app is closed and in the background.
I check it like this:

if (message.notification_opened) { const QString key = QStringLiteral("launchnotification"); data.insert(key, true); }

Regards Isy

API 34 Firebase crash on App::Create with C++ SDK - it works ok on API 33 built

[READ] For Firebase C++ SDK issues, please report to Firebase C++ open-source

Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Please fill in the following fields:

  • Which Firebase Sample: *APP_ (Auth, Database, etc.)
  • Firebase C++ SDK version: 11.0.4_
  • Additional SDKs you are using: _none (Facebook, AdMob, etc.)
  • Platform you are using the SDK on: _Android (Mac, Windows, or Linux)
  • Platform you are targeting: android API 34___ (iOS, Android, and/or desktop)

[REQUIRED] Please describe the issue here:

only on API 34. issue is the jar file permission set rw--
my guess api 34 wants to see a read-only app_resources_lib.jar in cache directory

java_vm_ext.cc:591] JNI DETECTED ERROR IN APPLICATION: JNI NewStringUTF called with pending exception java.lang.SecurityException: Writable dex file '/data/user/0/com.xxxxx.xxxxxx/cache/app_resources_lib.jar' is not allowed.
java_vm_ext.cc:591] at java.lang.Object dalvik.system.DexFile.openDexFileNative(java.lang.String, java.lang.String, int, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexFile.java:-2)
java_vm_ext.cc:591] at java.lang.Object dalvik.system.DexFile.openDexFile(java.lang.String, java.lang.String, int, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexFile.java:406)
java_vm_ext.cc:591] at void dalvik.system.DexFile.(java.lang.String, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexFile.java:128)
java_vm_ext.cc:591] at void dalvik.system.DexFile.(java.io.File, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexFile.java:101)
java_vm_ext.cc:591] at dalvik.system.DexFile dalvik.system.DexPathList.loadDexFile(java.io.File, java.io.File, java.lang.ClassLoader, dalvik.system.DexPathList$Element[]) (DexPathList.java:438)
java_vm_ext.cc:591] at dalvik.system.DexPathList$Element[] dalvik.system.DexPathList.makeDexElements(java.util.List, java.io.File, java.util.List, java.lang.ClassLoader, boolean) (DexPathList.java:397)
java_vm_ext.cc:591] at void dalvik.system.DexPathList.(java.lang.ClassLoader, java.lang.String, java.lang.String, java.io.File, boolean) (DexPathList.java:166)
java_vm_ext.cc:591] at void dalvik.system.BaseDexClassLoader.(java.lang.String, java.lang.String, java.lang.ClassLoader, java.lang.ClassLoader[], java.lang.ClassLoader[], boolean) (BaseDexClassLoader.java:160)
java_vm_ext.cc:591] at void dalvik.system.BaseDexClassLoader.(java.lang.String, java.io.File, java.lang.String, java.lang.ClassLoader) (BaseDexClassLoader.java:105)
java_vm_ext.cc:591] at void dalvik.system.DexClassLoader.(java.lang.String, java.lang.String, java.lang.String, java.lang.ClassLoader) (DexClassLoader.java:55)
java_vm_ext.cc:591] at java.lang.String com.com.xxxxx.xxxxxx.MainActivity.stringFromJNI() (MainActivity.java:-2)
java_vm_ext.cc:591] at void com.com.xxxxx.xxxxxx.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:28)
java_vm_ext.cc:591] at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:8595)
java_vm_ext.cc:591] at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:8573)
java_vm_ext.cc:591] at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1456)
java_vm_ext.cc:591] at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:3764)
java_vm_ext.cc:591] at android.app.Activity android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.app.servertransaction.PendingTransactionActions, int, android.content.Intent) (ActivityThread.java:3922)
java_vm_ext.cc:591] at void android.app.servertransaction.LaunchActivityItem.execute(android.app.ClientTransactionHandler, android.os.IBinder, android.app.servertransaction.PendingTransactionActions) (LaunchActivityItem.java:103)
java_vm_ext.cc:591] at void android.app.servertransaction.TransactionExecutor.executeCallbacks(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:139)
java_vm_ext.cc:591] at void android.app.servertransaction.TransactionExecutor.execute(android.app.servertransaction.ClientTransaction) (TransactionExecutor.java:96)
java_vm_ext.cc:591] at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:2443)
java_vm_ext.cc:591] at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
java_vm_ext.cc:591] at boolean android.os.Looper.loopOnce(android.os.Looper, long, int) (Looper.java:205)
java_vm_ext.cc:591] at void android.os.Looper.loop() (Looper.java:294)
java_vm_ext.cc:591] at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:8176)
java_vm_ext.cc:591] at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
java_vm_ext.cc:591] at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:552)
java_vm_ext.cc:591] at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:971)
java_vm_ext.cc:591]

incompatibility with android sdk and cpp sdk

There some incompatibility:

  • firebasee android sdk - 10.2.4
  • firebase cpp sdk - 3.1.1
    So Firebase send invite but cant decode project id anr return Error 500.

05-12 04:21:18.676 16100-16156/ru.gogoo.sushi D/cocos2d-x debug info: Initializing Firebase for Android.
05-12 04:21:18.706 16100-16100/ru.gogoo.sushi D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=true
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: java.lang.NoSuchMethodError: no non-static method "Lcom/google/firebase/FirebaseOptions$Builder;.setProjectId(Ljava/lang/String;)Lcom/google/firebase/FirebaseOptions$Builder;"
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native Method)
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:72)
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1500)
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: java.lang.NoSuchMethodError: no non-static method "Lcom/google/firebase/FirebaseOptions;.getProjectId()Ljava/lang/String;"
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native Method)
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:72)
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1500)
05-12 04:21:18.736 16100-16156/ru.gogoo.sushi W/System.err: at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)
05-12 04:21:18.766 16100-16115/ru.gogoo.sushi W/art: Suspending all threads took: 21.118ms
05-12 04:21:18.776 16100-16144/ru.gogoo.sushi D/FA: Connected to remote service

I cant logevent by logevent fuction

[READ] For Firebase C++ SDK issues, please report to Firebase C++ open-source

Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Please fill in the following fields:

  • Which Firebase Sample: _Analystic (Auth, Database, etc.)
  • Firebase C++ SDK version: _11.1.0
  • Additional SDKs you are using: _____ (Facebook, AdMob, etc.)
  • Platform you are using the SDK on: _Windows (Mac, Windows, or Linux)
  • Platform you are targeting: desktop_ (iOS, Android, and/or desktop)

[REQUIRED] Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, and stack traces if available.)

Steps to reproduce:

What's the issue repro rate? (eg 100%, 1/5 etc)
100%

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
I cant get any event log by desktop_testapp

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

original desktop_testapp.exe and firebase c++ sdk built in VS2017 with google-services.json as folloing
{
"project_info": {
"project_number": "763855455698",
"project_id": "test-creative-cast-windows",
"storage_bucket": "test-creative-cast-windows.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:763855455698:android:35057ba684f2aba4a5b40b",
"android_client_info": {
"package_name": "com.optoma.desktop.windows"
}
},
"oauth_client": [
{
"client_id": "763855455698-ds6imkf2sb3vmqekr1pp9kodo0cm7v1v.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBjNdBKkltSN0ja-argRyDtgjioQK0Rx1w"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "763855455698-ds6imkf2sb3vmqekr1pp9kodo0cm7v1v.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "763855455698-s9ntkrdlvvi8n1vutm96m2rb3q9eh064.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.optoma.sender-windows"
}
}
]
}
}
}
],
"configuration_version": "1"
}

iOs FIRMessaging didReceiveMessage not implemented

Hello together, i implemented messaging on iOs but when i send a message in the firebase console
and the device gets the message it gives me this output:

2017-07-17 12:42:24.803 App[1608] [Firebase/Messaging][I-FCM002019] FIRMessaging received data-message, but FIRMessagingDelegate's-messaging:didReceiveMessage: not implemented

Is it possible that there is a missing function in the c++/ios part?

C++ driver support

Can you please tell me for firestore do you have driver support for c++ ?

or if we have to use c++ it has to go thru from firebase SDK?

Crashing on firebase::app::Create

Library

Firebase C++ SDK: 4.0.2

Problem

Been adding the Firebase SDK to an Android application which has been going relatively smoothly (looks like a well-designed SDK btw) but when it hits:

Env::app = firebase::App::Create(firebase::AppOptions(), JniHelper::getEnv(), JniHelper::getActivity());

It crashes with jmethodID was NULL.

Additional Information

I've checked the output of JniHelper::getEnv() and JniHelper::getActivity() and they look valid. It also complains about the missing methods as in issue #7.

I imagine that the SDK code that calls CallObjectMethodV attempts to get a jmethodID for a method but fails (am I right in thinking their arn't any required Java methods for the Android C++ SDK to work?) and nothing picks up that failure so CallObjectMethodV is called with a null argument.

Stack Trace

07-09 22:41:59.173 5290-5343/PACKAGE_NAME W/System.err: java.lang.NoSuchMethodError: no non-static method "Lcom/google/firebase/FirebaseOptions;.getProjectId()Ljava/lang/String;"
07-09 22:41:59.173 5290-5343/PACKAGE_NAME W/System.err:     at org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(Native Method)
07-09 22:41:59.173 5290-5343/PACKAGE_NAME W/System.err:     at org.cocos2dx.lib.Cocos2dxRenderer.onSurfaceCreated(Cocos2dxRenderer.java:73)
07-09 22:41:59.173 5290-5343/PACKAGE_NAME W/System.err:     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1539)
07-09 22:41:59.173 5290-5343/PACKAGE_NAME W/System.err:     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
07-09 22:41:59.180 5290-5343/PACKAGE_NAME W/zygote: Skipping duplicate class check due to unrecognized classloader
07-09 22:41:59.181 5290-5316/PACKAGE_NAME D/FA: Connected to remote service
07-09 22:41:59.182 5290-5316/PACKAGE_NAME V/FA: Processing queued up service tasks: 2
07-09 22:41:59.201 5290-5343/PACKAGE_NAME I/firebase: Firebase App initializing app PACKAGE_NAME (default 1).
>>> CRASH >>>
07-09 22:41:59.266 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504] JNI DETECTED ERROR IN APPLICATION: jmethodID was NULL
07-09 22:41:59.266 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]     in call to CallObjectMethodV
07-09 22:41:59.266 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]     from void org.cocos2dx.lib.Cocos2dxRenderer.nativeInit(int, int)
07-09 22:41:59.266 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504] "GLThread 236" prio=5 tid=17 Runnable
07-09 22:41:59.266 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   | group="main" sCount=0 dsCount=0 flags=0 obj=0x12f695b8 self=0xa16f8c00
07-09 22:41:59.266 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   | sysTid=5343 nice=0 cgrp=default sched=0/0 handle=0x9078b970
07-09 22:41:59.266 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   | state=R schedstat=( 57357316 35185279 53 ) utm=2 stm=3 core=1 HZ=100
07-09 22:41:59.266 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   | stack=0x90689000-0x9068b000 stackSize=1038KB
07-09 22:41:59.266 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   | held mutexes= "mutator lock"(shared held)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #00 pc 0047358b  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+203)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #01 pc 0056ee2e  /system/lib/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMapb+366)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #02 pc 005696b3  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMapb+83)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #03 pc 00385e3e  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1374)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #04 pc 003863c1  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_Pc+113)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #05 pc 0014ea45  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+69)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #06 pc 0014e2c8  /system/lib/libart.so (_ZN3art11ScopedCheck13CheckMethodIDEP10_jmethodID+232)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #07 pc 0014d191  /system/lib/libart.so (_ZN3art11ScopedCheck22CheckPossibleHeapValueERNS_18ScopedObjectAccessEcNS_12JniValueTypeE+289)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #08 pc 0014c6b3  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE+1155)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #09 pc 001524d9  /system/lib/libart.so (_ZN3art8CheckJNI13CheckCallArgsERNS_18ScopedObjectAccessERNS_11ScopedCheckEP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDNS_10InvokeTypeEPKNS_7VarArgsE+185)
07-09 22:41:59.267 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #10 pc 0015161d  /system/lib/libart.so (_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDPcNS_9Primitive4TypeENS_10InvokeTypeE+1133)
07-09 22:41:59.272 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #11 pc 0013b73b  /system/lib/libart.so (_ZN3art8CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDPc+75)
07-09 22:41:59.272 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #12 pc 00494737  /data/app/PACKAGE_NAME-wnt1NlfuJlTadMzzuYlqPw==/lib/x86/libMyGame.so (???)
07-09 22:41:59.272 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #13 pc 0049e30c  /data/app/PACKAGE_NAME-wnt1NlfuJlTadMzzuYlqPw==/lib/x86/libMyGame.so (???)
07-09 22:41:59.272 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #14 pc 0049e8df  /data/app/PACKAGE_NAME-wnt1NlfuJlTadMzzuYlqPw==/lib/x86/libMyGame.so (_ZN8firebase3App6CreateERKNS_10AppOptionsEPKcP7_JNIEnvP8_jobject+501)
07-09 22:41:59.272 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #15 pc 0049eba1  /data/app/PACKAGE_NAME-wnt1NlfuJlTadMzzuYlqPw==/lib/x86/libMyGame.so (_ZN8firebase3App6CreateERKNS_10AppOptionsEP7_JNIEnvP8_jobject+55)
07-09 22:41:59.272 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #16 pc 004820dc  /data/app/PACKAGE_NAME-wnt1NlfuJlTadMzzuYlqPw==/lib/x86/libMyGame.so (_ZN11AppDelegate29applicationDidFinishLaunchingEv+824)
07-09 22:41:59.272 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #17 pc 004879ea  /data/app/PACKAGE_NAME-wnt1NlfuJlTadMzzuYlqPw==/lib/x86/libMyGame.so (_ZN7cocos2d11Application3runEv+24)
07-09 22:41:59.272 5290-5343/PACKAGE_NAME A/zygote: java_vm_ext.cc:504]   native: #18 pc 0048c5f4  /data/app/PACKAGE_NAME-wnt1NlfuJlTadMzzuYlqPw==/lib/x86/libMyGame.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit+223)

Storage: Unable to create StorageReference from URL

I had that issue when moving firebase implementation (Analytics, RealtimeDB, RemoteConfig, Storage) from native android sdk to cpp sdk. Everything seem to be OK but when i tried to get reference by calling GetReferenceFromUrl() it return error: -Unable to create StorageReference from URL - URL specifies a different bucket (firebasestorage.googleapis.com) than this instance ([my custom bucket]). My URL is download URL of Firebase storage (https://firebasestorage.googleapis.com/v0/b/[my custom bucket]/o/ [my file]). Note: it work fine when i using native android SDK. Please help!

Is there a wrapper for c# planned?

C# is a big framework and many people are requesting a sdk. after you dont have a c# sdk maybe it is worth to provide a wrapper for your c++sdk

Shutdown and re-initialization of some components / modules causes crashes

Hi, I'm the maintainer of https://github.com/Larpon/QtFirebase (a Qt wrap around the Firebase C++ SDK).

I've noticed crashes in some modules after a call to Terminate - and then trying to reinitialize by calling ModuleInitializer::Initialize - is this expected behaviour?

I'm asking because it's fairly common practice to initialize Qt/QML via dynamic Loader elements that will cause a complete life-cycle change of a module:

  1. Initialize app
  2. Load QML UI on demand when user clicks specific menu entry (call to ModuleInitializer::Initialize)
  3. Unload QML UI (call to Terminate) - when user navigates back
  4. User goes elsewhere in the app
  5. Load QML UI on demand when user clicks specific menu entry (call to ModuleInitializer::Initialize)
  6. Crash

I just wanted to know if I'm doing something wrong or ? - doing a single cycle initialize + terminate seem to work like a charm.

I'll have to document the behaviour to our users somehow - so I got curious :)

[Android] Cloud Functions returning arrays are not correctly parsed

Reproduction source code: #31

Operating system: Android
Operating system version: minSDK: 14,15,16 buildSDK:26 & 27
C++ SDK: 5.2.0 & 5.1.1
Dependencies: implementation 'com.google.firebase:firebase-functions:16.1.0'

What steps will reproduce the problem:

  1. Using firebase/functions, call a Cloud function that returns an array (filled) as the value of the data return... E.g:
exports.echoBody = functions.https.onRequest((request, response) => {
    response.status(200);
    response.json({ data : ['this', 'is' 1, 'test'] } );
});
  1. When the future completes, check the result->data() variant. It is kNullType

What is the expected result?
Using the iOS SDK, the result is the array.

What happens instead of that?
Null is returned. I suspect that the parsing of array/vectors are not implemented or are interpreted differently.

Please provide any other information below, and attach a screenshot if possible.
I stumbled across this issue implementing server side receipt checking for IAB. I use a 3rd party source that returns the validated receipt as an array of objects, each object representing a SKU (+State). For iOS, this works perfectly. When implementing the same calls for Android, I get a null response. I debugged both sides of the app, including turning on logging for my Cloud functions to log the return value. I even checked using Postman: the server response is valid.

Next, I forked quickstart-cpp, cloned the database example and re-purposed it to test Cloud Functions (See #31). The tests all run correctly (even with the Int64/Double issue) with the exception of Arrays/Vectors returning null. (See functions/testapp/src/common_main.cc )

firebase admob link error

when I add admob by

firebase::admob::Initialize(*app);

I got a linker error

./firebase/admob/client/cpp/src/common.h:42: error: undefined reference to 'firebase::ReferenceCountedFutureImpl::~ReferenceCountedFutureImpl()'
firebase/admob/client/cpp/src/banner_view_android.cc:45: error: undefined reference to 'vtable for firebase::ReferenceCountedFutureImpl'
/Users/xx/Developer/tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function (see go/missingkeymethod)
./firebase/admob/client/cpp/src/common.h:42: error: undefined reference to 'firebase::ReferenceCountedFutureImpl::~ReferenceCountedFutureImpl()'
firebase/admob/client/cpp/src/interstitial_ad_android.cc:41: error: undefined reference to 'vtable for firebase::ReferenceCountedFutureImpl'
/Users/xx/Developer/tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: the vtable symbol may be undefined because the class is missing its key function (see go/missingkeymethod)
./firebase/app/client/cpp/src/reference_counted_future_impl.h:280: error: undefined reference to 'firebase::ReferenceCountedFutureImpl::AllocInternal(int, void_, void ()(void))'
./firebase/app/client/cpp/src/reference_counted_future_impl.h:127: error: undefined reference to 'firebase::ReferenceCountedFutureImpl::BackingFromHandle(unsigned int)'
./firebase/app/client/cpp/src/reference_counted_future_impl.h:132: error: undefined reference to 'firebase::ReferenceCountedFutureImpl::SetBackingError(firebase::FutureBackingData_, int, char const_)'
./firebase/app/client/cpp/src/reference_counted_future_impl.h:135: error: undefined reference to 'firebase::ReferenceCountedFutureImpl::BackingData(firebase::FutureBackingData_)'
./firebase/app/client/cpp/src/reference_counted_future_impl.h:138: error: undefined reference to 'firebase::ReferenceCountedFutureImpl::CompleteHandle(unsigned int)'
./firebase/app/client/cpp/src/reference_counted_future_impl.h:280: error: undefined reference to 'firebase::ReferenceCountedFutureImpl::AllocInternal(int, void_, void (_)(void*))'
collect2: error: ld returned 1 exit status

[Desktop] [Database] [ARM - Raspberry Pi] Compile problem

Please fill in the following fields:

Firebase C++ SDK version: 6.9.0
Firebase plugins in use: App, Auth, Database
Platform you are using the SDK on (Mac, Windows, or Linux): Raspberry Pi 4 - Raspbian
Platform you are targeting (iOS, Android, and/or desktop): desktop

I have problem with compilation database_testapp on Raspberry Pi 4. CPU it's not x86/64, but ARM and when I use command: "cmake --build ." I have problem like this:

[100%] Linking CXX executable desktop_testapp
/usr/bin/ld: /home/pi/e-signboard/firebase_cpp_sdk/libs/linux/x86_64/libfirebase_database.a: error adding symbols: file format not recognized
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/desktop_testapp.dir/build.make:102: desktop_testapp] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/desktop_testapp.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

On Intel i5-6300HQ and Ubuntu 18.04 LTS everything is fine. I tryied use all libs, but all didn't work.

Is a chance to compile this program on Raspberry with C++ code? I need Firebase Database to use with Raspberry. I know there are Helper Library like pyrebase, etc., but code is in Python.

Setting minimum session duration to 1s and session timeout to 5s will result is lots of session

The default session configuration is 10 seconds minimum session and 30 minutes session time out. There is a reason why we choose this values. Setting session timeout to 5 seconds practically means every time the app is backgrounded a new session will be recorded. This defeats the purpose of session. The example app should set the default values instead of 1/5seconds:

// App needs to be open at least 10s before session will be started
analytics::SetMinimumSessionDuration(10000);
// App session times out after 30 minutes
analytics::SetSessionTimeoutDuration(1800000);

iOS: Linker Error after update to Cpp version 4.4.2

We recently reported this issue (#21 (comment)) and now tried to update to the latest version on iOS:

We downloaded iOS SDK version 4.9.0 and CPP SDK version 4.4.2 and added these frameworks (manually, no CocoaPods) to Xcode:

image

Unfortunately, we're getting this linker error:

Undefined symbols for architecture arm64:
  "flatbuffers::Parser::ParseFlexBuffer(char const*, char const*, flexbuffers::Builder*)", referenced from:
      firebase::util::JsonToVariant(char const*) in firebase(variant_util_be3a3a6b14e247f3427cf0fbbde761a7.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

We already tried to add all of the CPP framework files to the project, hoping that the missing parts would be in one of the other frameworks - but this didn't help. It seems like none of the frameworks contain the missing piece.

What can we do to get it running again?

Sample still using Deprecated Firebase AdMob firebase::admob

[REQUIRED] Please fill in the following fields:

  • Which Firebase Sample: Admob(Auth, Database, etc.)
  • Firebase C++ SDK version: firebase_cpp_sdk_11.6.0
  • Additional SDKs you are using: Admob (Facebook, AdMob, etc.)
  • Platform you are using the SDK on: Windows (Mac, Windows, or Linux)
  • Platform you are targeting: Android(iOS, Android, and/or desktop)

[REQUIRED] Please describe the issue here:

The sample files seem to be out of date, they have not been update to include the change from
recated Firebase AdMob C++ SDK"firebase::admob" to New Google Mobile Ads C++ SDK

(Please list the full steps to reproduce the issue. Include device logs, and stack traces if available.)

Steps to reproduce:

What's the issue repro rate? (eg 100%, 1/5 etc)

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Download and following information in sample to setup and run a sample code

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

// A simple listener that logs changes to a BannerView.
class LoggingBannerViewListener : public firebase::admob::BannerView::Listener {
 public:
  LoggingBannerViewListener() {}
  void OnPresentationStateChanged(
      firebase::admob::BannerView* banner_view,
      firebase::admob::BannerView::PresentationState state) override {
    ::LogMessage("BannerView PresentationState has changed to %d.", state);
  }
  void OnBoundingBoxChanged(firebase::admob::BannerView* banner_view,
                            firebase::admob::BoundingBox box) override {
    ::LogMessage(
        "BannerView BoundingBox has changed to (x: %d, y: %d, width: %d, "
        "height %d).",
        box.x, box.y, box.width, box.height);
  }
};`// A simple listener that logs changes to a BannerView.
class LoggingBannerViewListener : public firebase::admob::BannerView::Listener {
 public:
  LoggingBannerViewListener() {}
  void OnPresentationStateChanged(
      firebase::admob::BannerView* banner_view,
      firebase::admob::BannerView::PresentationState state) override {
    ::LogMessage("BannerView PresentationState has changed to %d.", state);
  }
  void OnBoundingBoxChanged(firebase::admob::BannerView* banner_view,
                            firebase::admob::BoundingBox box) override {
    ::LogMessage(
        "BannerView BoundingBox has changed to (x: %d, y: %d, width: %d, "
        "height %d).",
        box.x, box.y, box.width, box.height);
  }
};

E:/code2023/123456/testapp/src/common_main.cc:26:52: error: no member named 'admob' in namespace 'firebase'
class LoggingBannerViewListener : public firebase::admob::BannerView::Listener {`

firebase::database::MutableData bug

firebase::database::MutableData have too many bugs,
for example:
a simple test, in transaction function:

std::vectorfirebase::database::MutableData xxList;
xxList.push_back(data->Child("xxsdd") );
xxList[0].set_value("aaaa");

then will crash, seems like if I keep the MutableData on heap memory, then will crash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.