Giter Site home page Giter Site logo

firebaseextended / cocos2dx-cpp-sample Goto Github PK

View Code? Open in Web Editor NEW
55.0 28.0 25.0 93 KB

Firebase Cocos2d-x samples

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

License: MIT License

C++ 84.21% Ruby 0.79% C 1.33% Makefile 3.49% Python 10.19%
firebase firebase-remote-config firebase-auth firebase-analytics firebase-cloud-messaging cpp firebase-admob cocos2d-x firebase-cocos2d

cocos2dx-cpp-sample's Introduction

Firebase Cocos2d-x Samples

iOS and Android cocos2d-x samples for the Firebase C++ SDK.

Status

Status: Archived

This sample is no longer actively maintained and is left here for reference only.

Introduction

Prerequisites

  • The setup_firebase_sample.py script requires Python to be installed locally. Visit the Python download page for more information.

  • If you are running this script on a Mac, you will need CocoaPods installed. See the CocoaPods Getting Started guide for more details.

Getting Started

  • Clone the Firebase Cocos2d-x Samples GitHub repo.
    git clone https://github.com/firebase/cocos2dx-cpp-sample.git
    
  • Navigate to the directory that you just cloned and run the Firebase setup script, where FIREBASE_FEATURE is one of the following: AdMob, Analytics, Auth, Invites, Messaging, Remote_Config
    python setup_firebase_sample.py FIREBASE_FEATURE
    
  • If you haven't done so already, you will need to add the cocos2d-x environment variables to the operating system's PATH variable. Navigate to the sample_project/cocos2d directory and run the cocos2d-x setup script:
    python setup.py
    

iOS

  • Follow the steps in Set up your app in Firebase console.
    • Bundle ID: org.cocos2dx.hellocpp
  • Open the sample_project/proj.ios_mac/HelloCpp.xcworkspace with Xcode. From the Project Navigator, right click on HelloCpp and select “Add files to HelloCpp.” Find the GoogleService-Info.plist file that you downloaded in step 1 and click the Add button.
  • In the top left corner, set the active scheme to HelloCpp-mobile and choose the device that you want to run the app on. Then, click the run button to build and run the app.

Android

  • Follow the steps in Set up your app in Firebase console.
    • Package Name: org.cocos2dx.hellocpp
  • Add the google-services.json file that you downloaded in step 1 to the sample_project/proj.android-studio/app directory.
  • In the terminal from the sample_project directory, compile the Cocos project for Android:
    cocos compile -p android --ap ## --android-studio --app-abi armeabi-v7a
    
    Where ## is the Android platform used for building the apk, for example, android-22.
  • Open the sample_project/proj.android-studio project in Android Studio and run the app. To install the APK on a device, navigate to sample_project/bin/debug/android.

Support

https://firebase.google.com/support/

License

Copyright 2017 Google Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cocos2dx-cpp-sample's People

Contributors

alexames avatar formatcvt avatar morganchen12 avatar samtstern 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

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

cocos2dx-cpp-sample's Issues

Database Offline Capabilities

Can you please give example with offline support? Just set_persistence_enabled before creating any instances of DatabaseReference doesn't help. Feature query/set freezes with kFutureStatusPending status.

IOS Compile

Only run:
./setup_firebase_sample.py Database

Install all perfect compile in Xcode
when run it in Simulator show in console this error:

018-08-22 13:10:37.651463-0500 HelloCpp-mobile[6981:234685] +[CATransaction synchronize] called within transaction

{
gl.supports_OES_map_buffer: true
gl.supports_vertex_array_object: true
cocos2d.x.version: cocos2d-x-3.14.1
gl.vendor: Apple Inc.
gl.supports_PVRTC: true
gl.renderer: Apple Software Renderer
cocos2d.x.compiled_with_profiler: false
gl.supports_S3TC: false
gl.version: OpenGL ES 2.0 APPLE-16.4.2
cocos2d.x.build_type: DEBUG
gl.max_texture_size: 4096
gl.supports_ETC1: false
gl.supports_BGRA8888: false
gl.max_texture_units: 8
gl.max_samples_allowed: 4
gl.supports_OES_packed_depth_stencil: true
gl.supports_ATITC: false
gl.supports_NPOT: true
gl.supports_discard_framebuffer: true
cocos2d.x.compiled_with_gl_state_cache: true
gl.supports_OES_depth24: true
}

Initializing Firebase for iOS.
2018-08-22 13:10:44.382383-0500 HelloCpp-mobile[6981:234685] No default app present, ignore the previous FIRApp configuration warning (I-COR000003).
2018-08-22 13:10:44.383055-0500 HelloCpp-mobile[6981:237170] [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure]; (FirebaseApp.configure() in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
2018-08-22 13:10:44.383 HelloCpp-mobile[6981] [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add [FIRApp configure]; (FirebaseApp.configure() in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
2018-08-22 13:10:46.527216-0500 HelloCpp-mobile[6981:238042] [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2018-08-22 13:10:46.527 HelloCpp-mobile[6981] [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2018-08-22 13:10:46.533859-0500 HelloCpp-mobile[6981:238042] [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40002000 started
2018-08-22 13:10:46.534 HelloCpp-mobile[6981] [Firebase/Analytics][I-ACS023007] Firebase Analytics v.40002000 started
2018-08-22 13:10:46.534332-0500 HelloCpp-mobile[6981:238042] [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2018-08-22 13:10:46.534 HelloCpp-mobile[6981] [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2018-08-22 13:10:47.876208-0500 HelloCpp-mobile[6981:234685] +[FIRApp registerLibrary:withVersion:]: unrecognized selector sent to class 0x109a61580
2018-08-22 13:10:49.010612-0500 HelloCpp-mobile[6981:234685] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[FIRApp registerLibrary:withVersion:]: unrecognized selector sent to class 0x109a61580'
*** First throw call stack:
(
0 CoreFoundation 0x00000001103ec1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010fa81031 objc_exception_throw + 48
2 CoreFoundation 0x000000011046d6c4 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000011036e898 forwarding + 1432
4 CoreFoundation 0x000000011036e278 _CF_forwarding_prep_0 + 120
5 HelloCpp-mobile 0x00000001093b43a8 ZN8firebase3App15RegisterLibraryEPKcS2 + 120
6 HelloCpp-mobile 0x00000001093b1cdc _ZN8firebase10app_common6AddAppEPNS_3AppEbPNSt3__13mapINS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEENS_10InitResultENS3_4lessISA_EENS8_INS3_4pairIKSA_SB_EEEEEE + 610
7 HelloCpp-mobile 0x00000001093b30fd _ZN8firebase3App6CreateERKNS_10AppOptionsEPKc + 661
8 HelloCpp-mobile 0x0000000109218778 _ZN11AppDelegate29applicationDidFinishLaunchingEv + 888
9 HelloCpp-mobile 0x00000001093ea564 _ZN7cocos2d11Application3runEv + 36
10 HelloCpp-mobile 0x00000001092195ee -[AppController application:didFinishLaunchingWithOptions:] + 670
11 UIKit 0x000000010c44b6fb -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 278
12 UIKit 0x000000010c44d172 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4123
13 UIKit 0x000000010c4525cb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1677
14 UIKit 0x000000010c814f7e __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
15 UIKit 0x000000010cbe7a39 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
16 UIKit 0x000000010c814bba -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
17 UIKit 0x000000010c8153db -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
18 UIKit 0x000000010d186614 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
19 UIKit 0x000000010d1864ae -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
20 UIKit 0x000000010ce6a75d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
21 UIKit 0x000000010d0654b7 _performActionsWithDelayForTransitionContext + 100
22 UIKit 0x000000010ce6a627 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
23 UIKit 0x000000010cbe70e0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
24 UIKit 0x000000010c450eac -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
25 UIKit 0x000000010ca23bcb -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
26 FrontBoardServices 0x00000001147352f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
27 FrontBoardServices 0x000000011473dcfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
28 libdispatch.dylib 0x00000001109637ec _dispatch_client_callout + 8
29 libdispatch.dylib 0x0000000110968db8 _dispatch_block_invoke_direct + 592
30 FrontBoardServices 0x0000000114769470 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
31 FrontBoardServices 0x000000011476912e -[FBSSerialQueue _performNext] + 439
32 FrontBoardServices 0x000000011476968e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
33 CoreFoundation 0x000000011038ebb1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
34 CoreFoundation 0x00000001103734af __CFRunLoopDoSources0 + 271
35 CoreFoundation 0x0000000110372a6f __CFRunLoopRun + 1263
36 CoreFoundation 0x000000011037230b CFRunLoopRunSpecific + 635
37 GraphicsServices 0x00000001133baa73 GSEventRunModal + 62
38 UIKit 0x000000010c454057 UIApplicationMain + 159
39 HelloCpp-mobile 0x0000000109224ce1 main + 65
40 libdyld.dylib 0x00000001109e0955 start + 1
41 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

AdMob crash in cocos2d-x 3.15.1. Android Studio 2.3.3

Hi,
I run AdMob example in cocos2d-x 3.14 it work fine, but I upgrade to cocos 3.15.1 it crash when run on device. I test on Samsung galaxy s6 android 7. This is log:

java.lang.UnsatisfiedLinkError: No implementation found for void org.cocos2dx.lib.Cocos2dxEngineDataManager.nativeSetSupportOptimization(boolean) (tried Java_org_cocos2dx_lib_Cocos2dxEngineDataManager_nativeSetSupportOptimization and Java_org_cocos2dx_lib_Cocos2dxEngineDataManager_nativeSetSupportOptimization__Z)
at org.cocos2dx.lib.Cocos2dxEngineDataManager.nativeSetSupportOptimization(Native Method)
at org.cocos2dx.lib.Cocos2dxEngineDataManager.init(Cocos2dxEngineDataManager.java:149)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:288)
at android.app.Activity.performCreate(Activity.java:6942)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

Compile error

Tried to build AdMob project in Android.

After typing this cmd "python setup_firebase_sample.py AdMob"
I moved to sample_project folder and tried to build it but encoutnering this error.
I'm using NDK version 15.
Python 2.7.10
cocos2d-x-3.15
Cocos Console 2.3
Complie version 22

minjis-MacBook-Pro:sample_project minjisong$ pwd
/Users/minjisong/cocos2dx-cpp-sample/sample_project
minjis-MacBook-Pro:sample_project minjisong$ cocos compile -p android --ap android-22 --android-studio --app-abi armeabi-v7a
Python 2.7.10
Building mode: debug
Using Android Studio project : /Users/minjisong/cocos2dx-cpp-sample/sample_project/proj.android-studio
Building native...
NDK build mode: debug
running: '/Users/minjisong/Library/Android/sdk/ndk-bundle/ndk-build -C /Users/minjisong/cocos2dx-cpp-sample/sample_project/proj.android-studio/app -j4 APP_ABI="armeabi-v7a" NDK_MODULE_PATH=/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d:/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos:/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/external NDK_TOOLCHAIN_VERSION=4.9 NDK_DEBUG=1'

Android NDK: Found platform level in ./project.properties. Setting APP_PLATFORM to android-22.    
Android NDK: WARNING: APP_PLATFORM android-22 is higher than android:minSdkVersion 1 in ./AndroidManifest.xml. NDK binaries will *not* be comptible with devices older than android-22. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.    
make: Entering directory `/Users/minjisong/cocos2dx-cpp-sample/sample_project/proj.android-studio/app'
[armeabi-v7a] Compile++ arm  : cocostudio_static <= WidgetReader.cpp
[armeabi-v7a] Compile++ arm  : cocostudio_static <= FlatBuffersSerialize.cpp
[armeabi-v7a] Compile++ arm  : cocostudio_static <= WidgetCallBackHandlerProtocol.cpp
[armeabi-v7a] Compile++ arm  : cocostudio_static <= CCComExtensionData.cpp
[armeabi-v7a] Compile++ arm  : cocostudio_static <= CocoStudio.cpp
[armeabi-v7a] Compile++ arm  : cocos_ui_static <= UILayoutComponent.cpp
[armeabi-v7a] Compile++ arm  : cocos_ui_static <= UITabControl.cpp
[armeabi-v7a] Compile++ thumb: audioengine_static <= CCThreadPool.cpp
[armeabi-v7a] Compile++ thumb: audioengine_static <= AssetFd.cpp
[armeabi-v7a] Compile++ thumb: audioengine_static <= AudioDecoder.cpp
[armeabi-v7a] Compile++ thumb: audioengine_static <= AudioPlayerProvider.cpp
[armeabi-v7a] Compile++ thumb: audioengine_static <= AudioResampler.cpp
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp: In constructor 'cocos2d::experimental::AudioDecoder::AudioDecoder(SLEngineItf, const string&, int, int, const FdGetterCallback&)':
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp:108:73: error: 'malloc' was not declared in this scope
     _pcmData = (char*) malloc(NB_BUFFERS_IN_QUEUE * BUFFER_SIZE_IN_BYTES);
                                                                         ^
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp: In destructor 'virtual cocos2d::experimental::AudioDecoder::~AudioDecoder()':
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp:126:18: error: 'free' was not declared in this scope
     free(_pcmData);
                  ^
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp: In member function 'bool cocos2d::experimental::AudioDecoder::decodeToPcm()':
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp:405:52: error: 'malloc' was not declared in this scope
         keyInfo = (SLMetadataInfo *) malloc(keySize);
                                                    ^
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp:434:25: error: 'free' was not declared in this scope
             free(keyInfo);
                         ^
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp: In member function 'bool cocos2d::experimental::AudioDecoder::resample()':
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp:504:42: error: 'malloc' was not declared in this scope
     void *outputVAddr = malloc(outputSize);
                                          ^
/Users/minjisong/cocos2dx-cpp-sample/sample_project/cocos2d/cocos/audio/android/AudioDecoder.cpp:594:17: error: 'free' was not declared in this scope
     free(convert);
                 ^
[armeabi-v7a] Compile++ thumb: audioengine_static <= AudioResamplerCubic.cpp
make: *** [obj/local/armeabi-v7a/objs-debug/audioengine_static/AudioDecoder.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/Users/minjisong/cocos2dx-cpp-sample/sample_project/proj.android-studio/app'
Error running command, return code: 2.

Any solution for this?

error: call to unavailable function 'system': not available on iOS

I was following your instructions to build sample firebase cocos2d-x project for Analytics and got this error:

sample/sample_project/cocos2d/cocos/platform/CCFileUtils.cpp:1156:9: error: call to unavailable function 'system': not available on iOS
    if (system(command.c_str()) >= 0)
        ^~~~~~

You guys need to cherry pick this fix to resolve the issue: remove "system" usage #17921 which I applied locally and was able to get the project build and run.

Issue with the file download from firebase cloud storage

Hi,

I am trying to download a file to local storage on ios. Download completes 100% but unable to save it in local storage.

std::string filePath = FileUtils::getInstance()->getWritablePath() + "cuts.zip"; // path used for storing
get_bytes_future_ = reference.GetFile(filePath.c_str(), &this->listener_);

Getting an error "The file couldn’t be opened because the specified URL type isn’t supported."

Could you please help me to solve this?

incompatiblity 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

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

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.

Unable to find Method com/google/firebase/remoteconfig/FirebaseRemoteConfig.setDefaults. Please verify the AAR which contains the com/google/firebase/remoteconfig/FirebaseRemoteConfig class is included in your app.

When i run sample code remote_config in cocos2dx-cpp-sample repository, i caught "A/firebase: Unable to find Method com/google/firebase/remoteconfig/FirebaseRemoteConfig.setDefaults (signature '(ILjava/lang/String;)V', instance). Please verify the AAR which contains the com/google/firebase/remoteconfig/FirebaseRemoteConfig class is included in your app." error.
Anyone have idea to fix that ? Tks

Java class com/google/firebase/FirebaseApp not found. Please verify the AAR which contains the com/google/firebase/FirebaseApp class is included in your app.

06-11 09:33:07.161 2083-2109/com.mygame.game1 E/FirebaseInstanceId: Google Play services missing or without correct permission.
06-11 09:33:07.353 2083-2111/com.mygame.game1 E/firebase: Java class com/google/firebase/FirebaseApp not found. Please verify the AAR which contains the com/google/firebase/FirebaseApp class is included in your app.
clazz
06-11 09:33:07.353 2083-2111/com.mygame.game1 A/firebase: Java class com/google/firebase/FirebaseApp not found. Please verify the AAR which contains the com/google/firebase/FirebaseApp class is included in your app.

*build.grade (Project:proj.android)
buildscript {
repositories {
google()
jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.google.gms:google-services:4.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
jcenter()
}
}

*build.grade (Module App)
......
dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':libcocos2dx')
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'

}

apply plugin: 'com.google.gms.google-services'

Is my application missing the firebase-ads-x-x.aar file ?

Can someone help me ? Thanks you very much!

_OBJC_CLASS_$_FIREmailPasswordAuthProvider linker error

Operating system: macos
Operating system version: 10.12.3
CocoaPods version: 1.2.1
Firebase C++ SDK version: 3.1.2

Podfile contents:
platform :ios, '8.0'
target 'firebaseTest-mobile' do
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/AdMob'
pod 'Firebase/Auth'
pod 'GoogleSignIn'
pod 'Firebase/Database'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
end

I'm trying to add Firebase C++ SDK to my cocos2d app. The app builds and runs successfully but when I add this piece of code:
std::string token = UserDefault::getInstance()->getStringForKey("GID"); firebase::auth::Credential credential = firebase::auth::GoogleAuthProvider::GetCredential(token.c_str(), nullptr);

a linker error appears:
Undefined symbols for architecture armv7: "_OBJC_CLASS_$_FIREmailPasswordAuthProvider", referenced from: objc-class-ref in firebase_auth(credential_ios_de0c3e1fa34e9a30835a63e195323a0f.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've added the $(inherited) flag to the Framework Search path, Other Linker Flags and Preprocessor Macros. The other suggestion from StackOverflow was to downgrade the pods version to 3.17.0. I tried it and this fixed the linker error but the app crashed in runtime on the same line of code and an exception was thrown '*** +[NSString stringWithUTF8String:]: NULL cString'

I also tried running the quickstart-cpp-master and the cocos2dx-cpp-sample but always got the same linker error.

Crash on android 4.4.2

Device: Samsung Note2 SHV-E250S
Android version: 4.4.2
cocos2d-x version: 3.14
NDK : r13b (64-bit)
SDK : android-23

E/dalvikvm: dlopen("/data/app-lib/com.test.test-2/libMyGame.so") failed: dlopen failed: cannot locate symbol "atof" referenced by "libMyGame.so"...
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x42315c08)
E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com.test.test PID: 30141
                                                   java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "atof" referenced by "libMyGame.so"...
                                                       at java.lang.Runtime.loadLibrary(Runtime.java:365)
                                                       at java.lang.System.loadLibrary(System.java:526)
                                                       at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:248)
                                                       at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:264)
                                                       at android.app.Activity.performCreate(Activity.java:5451)
                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
                                                       at android.app.ActivityThread.access$900(ActivityThread.java:175)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:146)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5602)
                                                       at java.lang.reflect.Method.invokeNative(Native Method)
                                                       at java.lang.reflect.Method.invoke(Method.java:515)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
                                                       at dalvik.system.NativeStart.main(Native Method)

Error to complie in IOS

Hi, in android work perfect compiled and run, (release and debug), If compiled with Xcode and command line "cocos compile" I got the same error result:
ld: warning: object file (/Users//Documents//cocos2dx-cpp-sample/sample_project/bin/debug/ios/libcocos2d iOS.a(ftlzw.ios8_i386.o)) was built for newer iOS version (7.0) than being linked (6.0)
Undefined symbols for architecture i386:
"OBJC_CLASS$_FIRTransactionResult", referenced from:
objc-class-ref in firebase_database(database_reference_ios_3449459c15aef7e31c8afe79eaa7793d.o)
"OBJC_CLASS$_FIRDatabase", referenced from:
objc-class-ref in firebase_database(database_ios_a510d85c52f977653ce87c71622b82b9.o)
"OBJC_CLASS$_FIRPhoneAuthProvider", referenced from:
objc-class-ref in firebase_auth(credential_ios_8842bea456a3d08991633ce351da4833.o)
"OBJC_CLASS$_FIRGoogleAuthProvider", referenced from:
objc-class-ref in firebase_auth(credential_ios_8842bea456a3d08991633ce351da4833.o)
"OBJC_CLASS$_FIRDatabaseReference", referenced from:
objc-class-ref in firebase_database(database_reference_ios_3449459c15aef7e31c8afe79eaa7793d.o)
"OBJC_CLASS$_FIRGitHubAuthProvider", referenced from:
objc-class-ref in firebase_auth(credential_ios_8842bea456a3d08991633ce351da4833.o)
"OBJC_CLASS$_FIREmailAuthProvider", referenced from:
objc-class-ref in firebase_auth(credential_ios_8842bea456a3d08991633ce351da4833.o)
"OBJC_CLASS$_FIRAuth", referenced from:
objc-class-ref in firebase_auth(auth_ios_aeeb64b45d2cf07d8a483d9b8a93eadf.o)
"OBJC_CLASS$_FIRTwitterAuthProvider", referenced from:
objc-class-ref in firebase_auth(credential_ios_8842bea456a3d08991633ce351da4833.o)
"OBJC_CLASS$_FIRPhoneAuthCredential", referenced from:
objc-class-ref in firebase_auth(user_ios_8c8add148e36bde3d728607314e5511d.o)
"OBJC_CLASS$_FIROAuthProvider", referenced from:
objc-class-ref in firebase_auth(credential_ios_8842bea456a3d08991633ce351da4833.o)
"OBJC_CLASS$_FIROptions", referenced from:
objc-class-ref in firebase(app_ios_bf85e0fc73a1028793d185e5f1e44a98.o)
"OBJC_CLASS$_FIRFacebookAuthProvider", referenced from:
objc-class-ref in firebase_auth(credential_ios_8842bea456a3d08991633ce351da4833.o)
"OBJC_CLASS$_FIRApp", referenced from:
objc-class-ref in firebase(app_ios_bf85e0fc73a1028793d185e5f1e44a98.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:
Ld /Users//Documents//cocos2d-x-3.13.1/cocos2dxnew-cpp-sample/cocos2dx-cpp-sample/sample_project/bin/debug/ios/HelloCpp-mobile.app/HelloCpp-mobile normal i386
(1 failure)
Build failed: Take a look at the output above for details.

I don't know I need to fixer.

Thank you.

Mac OSX Capitan v10.11.6
Xcode Version 8.2.1 (8C1002)

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.