SDKBOX(CLI and GUI) broken - cocos2d-X V4.0

Hi there,
I wanted to update my sdkbox CLI. It went half through the first time, and then somehow crashed.
Now when entering sdkbox update, I get the following error:
sdkbox update
_______ ______ _ _ ______ _____ _ _
|______ | \ |____/ |] | | _/
| |/ | _ |
] |____| _/ _
Copyright (c) 2016-2020 SDKBOX Inc. v1.4.4.0
^CTraceback (most recent call last):
File “monolith.py”, line 11626, in
File “monolith.py”, line 11601, in main
File “monolith.py”, line 9558, in perform
File “monolith.py”, line 9568, in perform
File “monolith.py”, line 10248, in main
File “monolith.py”, line 9558, in perform
File “monolith.py”, line 9568, in perform
File “monolith.py”, line 10923, in cmd_update
File “monolith.py”, line 10198, in load_projects
File “monolith.py”, line 10190, in create_projects
File “monolith.py”, line 2822, in init
File “monolith.py”, line 3008, in determine_cocos2dx_project_type
File “monolith.py”, line 357, in search_in_files
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 296, in walk
for x in walk(new_path, topdown, onerror, followlinks):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py”, line 286, in walk
if isdir(join(top, name)):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py”, line 49, in isdir
st = os.stat(s)
KeyboardInterrupt
> Log file = /Users/……./.sdkbox/log/sdkbox-log-2021-04-15-1.sdkbox.temp

I thought it might be a good idea to install the gui client then - however this also did not work. When installing a plugin - admob in this case, I get the following:


I think something is really broken here - is there away to uninstall everything completly(SDKBOX CLI AND GUI) so that I can start over again?
Or could @yinjimmy help me here? :slight_smile:

Any help is appreciated.

Maybe @htlxyz can help.

  • There are two xcode projects in your project.
  • SDKBox commands are stored in the path ~/.sdkbox, just delete it.
  • The way to delete SDKBox GUI is the same as other applications.
  • Install SDKBox, CLI Installer - SDKBOX
  • you can run sdkbox import admob under project root to import admob.

Thank you @htlxyz I am almost there now.
I followed your advice - then when building for iOS i run into a problem:

  • GoogleAppMeasurement.xcframework not found
  • GoogleMobileAds.xcframework not found

So I followed this tutorial here to fix it: Unable to build Xcode project after importing sdkbox - #7 by noprops

Now everything compiles and loads - however I got one final problem:

Terminating app due to uncaught exception ‘GADInvalidInitializationException’, reason: 'The Google Mobile Ads SDK was initialized without an application ID. Google AdMob publishers, follow instructions at https://googlemobileadssdk.page.link/admob-ios-update-plist to set a valid application ID.

I added my app ID in the sdkbox_config.json but this did not work.
I added it in the Info.plist using GADApplicationIdentifier - however this also did not work.

Am I doing something wrong here?

I got it now to work by:

setting the GADApplicationIdentifier in the Project: Target->Game-> Info :

Setting the GADApplicationIdentifier in the Info.plist in the CMake directory did not work.

After that the error was solved, however Admob was still not working.

It turned out that for some reason “SDKBOX_ENABLED” was always false - so after removing every #ifdef SDKBOX_ENABLED in code Admob would work.

I have somehow the feeling that I am doing things wrong here however.
Why is SDKBOX_ENABLED always false in my project although I installed it?
Why do I have to add some libraries manually as described here: Unable to build Xcode project after importing sdkbox - #7 by noprops?

@htlxyz could you confirm that this is the right way to load Admob with SDKbox for v4 C++ cocos2d-x? For me this seems very hacky :-/
Thank you :slight_smile:

1 Like
  • The Google Mobile Ads SDK was initialized without an application ID

Yes, the application id should be set in plist. “Google Mobile Ads SDK” will load the application id directly from plist.

  • CMake does not support xcframework, so integrate xcframework in xcode manually for now.
  • SDKBOX_ENABLED is false on ios

this should be enable in CMakeLists.txt, we will check this.

Thank you @htlxyz :grinning: :+1: