Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Compile error when try to use firebase::database::Database #6

Open

Description

@althurzard

My project uses firebase auth, database. When i tried to call the entry point for the Firebase Realtime Database C++ SDK, something like that
auto database = ::firebase::database::Database::GetInstance(firebase::App::GetInstance());

I should get these errors when compile on android

`[armeabi] Gdbserver : [arm-linux-androideabi-4.9] libs/armeabi/gdbserver
[armeabi] Gdbsetup : libs/armeabi/gdb.setup
[armeabi] SharedLibrary : libMyGame.so
firebase/database/client/cpp/src/android/database_android.cc:131: error: undefined reference to 'firebase::FutureManager::FutureManager()'
firebase/database/client/cpp/src/android/database_android.cc:309: error: undefined reference to 'firebase::FutureManager::~FutureManager()'
firebase/database/client/cpp/src/android/database_android.cc:309: error: undefined reference to 'firebase::FutureManager::~FutureManager()'
firebase/database/client/cpp/src/android/database_reference_android.cc:115: error: undefined reference to 'firebase::FutureManager::ReleaseFutureApi(void*)'
firebase/database/client/cpp/src/android/database_reference_android.cc:86: error: undefined reference to 'firebase::FutureManager::AllocFutureApi(void*, int)'
firebase/database/client/cpp/src/android/database_reference_android.cc:99: error: undefined reference to 'firebase::FutureManager::MoveFutureApi(void*, void*)'
firebase/database/client/cpp/src/android/database_reference_android.cc:105: error: undefined reference to 'firebase::FutureManager::MoveFutureApi(void*, void*)'
firebase/database/client/cpp/src/android/database_reference_android.cc:76: error: undefined reference to 'firebase::FutureManager::AllocFutureApi(void*, int)'
firebase/database/client/cpp/src/android/database_reference_android.cc:475: error: undefined reference to 'firebase::FutureManager::GetFutureApi(void*)'
firebase/database/client/cpp/src/android/disconnection_android.cc:48: error: undefined reference to 'firebase::FutureManager::AllocFutureApi(void*, int)'
firebase/database/client/cpp/src/android/disconnection_android.cc:56: error: undefined reference to 'firebase::FutureManager::ReleaseFutureApi(void*)'
firebase/database/client/cpp/src/android/disconnection_android.cc:236: error: undefined reference to 'firebase::FutureManager::GetFutureApi(void*)'
firebase/database/client/cpp/src/android/query_android.cc:135: error: undefined reference to 'firebase::FutureManager::ReleaseFutureApi(void*)'
firebase/database/client/cpp/src/android/query_android.cc:90: error: undefined reference to 'firebase::FutureManager::AllocFutureApi(void*, int)'
firebase/database/client/cpp/src/android/query_android.cc:117: error: undefined reference to 'firebase::FutureManager::MoveFutureApi(void*, void*)'
firebase/database/client/cpp/src/android/query_android.cc:124: error: undefined reference to 'firebase::FutureManager::MoveFutureApi(void*, void*)'
firebase/database/client/cpp/src/android/query_android.cc:640: error: undefined reference to 'firebase::FutureManager::GetFutureApi(void*)'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libMyGame.so] Error 1
Error running command, return code: 2.

If i comment out that line, everything goes right.

Activity

  1. althurzard commented on Apr 4, 2017

    @althurzard
    Author

    Just found the issue.
    I had to downgrade target version from 23 to 22
    cocos compile -p android --ap android-22 --android-studio.

  2. formatCvt commented on Apr 13, 2017

    @formatCvt
    Contributor

    what version of firebase sdk do you use?

  3. althurzard commented on Apr 13, 2017

    @althurzard
    Author

    @formatCvt Lastest version
    I could build project by using api android 22 or 24, but 23 should get that errors above.

  4. stewartmiles commented on Jun 9, 2017

    @stewartmiles
    Contributor

    @althurzard are you still seeing an issue?

  5. Solman28 commented on Jul 10, 2017

    @Solman28

    I get the same error, Somebody found the bug?

  6. althurzard commented on Jul 11, 2017

    @althurzard
    Author

    @stewartmiles i solved it. Just change to api android 22 or 24.

  7. Solman28 commented on Jul 11, 2017

    @Solman28

    Yes! I solved it using a Smartphone with android 5.1+

  8. delorenj commented on Jul 19, 2017

    @delorenj

    I tried changing to android 24 and the problem was not resolved =(

  9. delorenj commented on Jul 20, 2017

    @delorenj

    Ok, finally figured it out. The issue was the order of the linking:

    This produced the above error:

    LOCAL_STATIC_LIBRARIES := cocos2dx_static \
    firebase_app \
    firebase_analytics \
    firebase_auth \
    firebase_database
    

    And this resulted in a successful build:

    LOCAL_STATIC_LIBRARIES := cocos2dx_static \
    firebase_analytics \
    firebase_auth \
    firebase_database \
    firebase_app
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions