SDKBOX Integration without the Installer

@Kotaiba I am sure we can send you manual steps to do the installation. In the mean time, since you are having an issue, and we would like to solve this issue, would you mind helping us with a few tests so that we can solve this issue for others that may run into the same thing :smile:

  1. run sdkbox symbols from the cocos project directory that you are trying to install to. This will print out a bunch of keys and values. Can you reply to this post with that output?

  2. run sdkbox --help and paste all output including the sdkbox header with version number.

With this information we should be able to diagnose the problem and get you back into a working state. If not, I will find instructions on how to install this manually.

Thanks
Justin

1-

sdkbox symbols
 _______ ______  _     _ ______   _____  _     _
 |______ |     \ |____/  |_____] |     |  \___/ 
 ______| |_____/ |    \_ |_____] |_____| _/   \_
Copyright (c) 2015 Chukong Technologies Inc. v0.5.6.9

failed to find cocos2d-x installation directory
Installation failed :(

2-

sdkbox --help
 _______ ______  _     _ ______   _____  _     _
 |______ |     \ |____/  |_____] |     |  \___/ 
 ______| |_____/ |    \_ |_____] |_____| _/   \_
Copyright (c) 2015 Chukong Technologies Inc. v0.5.6.9
usage: sdkbox [-h] [-v] [-p [PROJECT]] [-s] [-b [PLUGIN]] [-D SYMBOL]
              [-o OUTPUT] [--encrypt ENCRYPT] [--decrypt DECRYPT] [--key KEY]
              [--dryrun] [--nohelp] [--forcedownload]
              {list,import,restore,symbols,api,update,encrypt,decrypt}

Import SDKBOX plugins into Cocos2d-x projects

positional arguments:
  {list,import,restore,symbols,api,update,encrypt,decrypt}
                        issue sdkbox installer command

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         specify verbosity level
  -p [PROJECT], --project [PROJECT]
                        path to project root (defaults to .)
  -s, --status          checks the server for update status
  -b [PLUGIN], --plugin [PLUGIN]
                        specify path to plugin (defaults to .)
  -D SYMBOL, --symbol SYMBOL
                        define a symbol for the package script
  -o OUTPUT, --output OUTPUT
                        specify output file
  --encrypt ENCRYPT     encrypt file
  --decrypt DECRYPT     decrypt file
  --key KEY             specify xxtea key (Key must be a 16-byte string.)
  --dryrun              display steps but do not perform any actions.
  --nohelp              don't open online documentation after installation.
  --forcedownload       force download of package even if it is already downloaded.

Examples:
# Add 'In App Purchase' plugin to your game
$ sdkbox import -b iap -p /path/to/your/cocos2dx/game/

# The -b option may be omitted and -p too if you are in your project directory
$ sdkbox import iap

# List all available modules
$ sdkbox list

I just finished integrating all the the SDKs except Google analytics need to know what to add to AndroidManifest.xml

This is screenshot of my project tree

can you check if there is a .cocos-project.json in your project directory?

if not, can you add it with the following contents. And try the sdkbox install again.

{
    "engine_type": "prebuilt", 
    "engine_version": "cocos2d-x-3.7", 
    "project_type": "cpp"
}

If this works, then the question becomes why don’t you have that file. How did you create the project? cocos new -l cpp project ?

Thanks
Justin

I use level helper to create my project . cocos2d-x 3.4
http://gamedevhelper.com/
if you create project via it i think you will face same problem .
i dont have cocos-project.json on my files .
can you point for me where it should be ?

I am having the same exact issues.

I have an old project built with cocos2d-x 3.1 and updated many times up to the 3.6 version. So, there is no .cocos-project.json file inside the main project directory.

Using the sdkbox installer tools from the root dir of the project used to give me the common failed to find cocos2d-x installation directory error.

I’ve previously run the ./setup.py from the root project dir, but with no success.

Then I’ve solved the issue doing this:

  1. Removed all the cocos2d-x-related settings from my .bashrc or .zshrc file in my user’s home directory
  2. Downloaded cocos2d-x 3.6 source code and extracted it in a place where I will keep it for the rest of my life :smile:
  3. Run ./setup.py from the cocos2d-x 3.6 source code directory
  4. Restarted the terminal
  5. Run sdkbox symbols from the root dir of the project and now it works!

Hope this helps!

hi.
can u inform me how to get sdkbox installer?

paste this to your command line and run it.

python -c "import urllib; s = urllib.urlopen('https://raw.githubusercontent.com/sdkbox-doc/en/master/install/install.py').read(); exec s"

Where to download sdkbox installer ???

OMG…How can anyone know this command line ?

curl: (22) The requested URL returned error: 404 Not Found

hi @Kotaiba

You can create one file by yourself.
create a new file with name “.cocos-project.json

After creating the file, write these into it -

{
    "engine_type": "prebuilt", 
    "engine_version": "cocos2d-x-3.7", 
    "project_type": "cpp"
}

Now save the file and paste it into your project root folder.

NOTE:

if you are on mac then this file will be invisible by default, if you haven’t turned on the visibility of all files.
Change this to your current cocos verison

 "engine_version": "cocos2d-x-3.x",

Hello @jinjin and @zllivedoor

You can download the SDKBOX installer here

Steps :

  1. Open the link, scroll down to the bottom of the page.
  2. Find this -

Download the first link saying Auto Installer.

A .zip file will be downloaded.

Mac User -

Unzip the file and copy it’s content to your usr/local/bin
so that sdkbox would be available to your terminal.

Windows Users -

If you want to keep it updated all time with latest release, unzip at any location and set the directory path as environment variable, so that sdkbox would be available to your cmd.

Project Specific

If you just want it for the project only.
you can unzip the contents of the auto-installer into your project root folder.

Let me know in case of any difficulty.

Hello @AbhyudaiRagh

That’s because the directory in which you are trying to import sdkbox plugins is not a game root directory.

You need to do this inside your root directory of the game you created.

For instance -

Say - C:\agd\games\DemoGame
is your root directory. Go to this directory in command prompt.
Now try to use sdkbox import -b <YOUR_DESIRED_PLUGIN>

and yes, if sdkbox is not found as internal or external command then please follow these steps mentioned inside the windows section.

Hello ,
I am using Ubantu 14 , eclipse adt .and want to integrate sdkbox inapp in my android game.
i put sdkbox-installer in to my project root “YourGameTitle”

~/MyWorkspace/Android/cocos2d-x-3.3/projects/iap/YourGameTitlefILE$ ./sdkbox import iap


|______ | \ |____/ |] | | _/
| |/ | _ |
] |____| _/ _
Copyright © 2015 Chukong Technologies Inc. v0.5.8.1
[Errno 2] No such file or directory: ‘/home/vikas/MyWorkspace/Android/cocos2d-x-3.3/projects/iap/YourGameTitlefILE/proj.android/src/org/cocos2dx/lib/Cocos2dxActivity.java’
Installation failed : (

can you please help me…

Hello @Arjun_Singh

First go inside this directory then run the command to import whatever plugins you want to integrate.

You need to be in your game project ROOT directory to be able to import plugins from sdkbox.

Best,
Pabitra

@pabitrapadhy thanks for your reply …i have done successfully

I read the rest of the post, no sign of that “Manual Installation” :slight_smile: could you please explain how its done in android studio? Ive downloaded the sdk from here down the page:
http://www.sdkbox.com/plugins/googleplayservices

sorry to invoke the topic after 2 years

http://docs.sdkbox.com/en/plugins/googleplay/v3-cpp/#manual-integration-for-android

Thanks, I did everything and doubled checked and I get the following error:

Information:Gradle tasks [:mProject:assembleDebug]
Error:error: ld returned 1 exit status
Information:BUILD FAILED
Information:Total time: 2 mins 9.195 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

Do you have any idea what could have caused this? Ill look for a quick answer here I also post an issue with more detail

need more info.

general steps: