Project Configuration

Last updated: 2020-04-01 16:44:00

    This document describes how to configure a Cocos2d project for the GME APIs for Cocos2d.

    SDK Preparations

    1. Download the applicable demo and SDK. For more information, please see Download Guide.
    2. Decompress the obtained SDK resources.
    3. The folder contains:
      • GMESDK: GME SDK framework file.
      • GMECocosDemo: GME SDK demo project.

    The SDK supports compilation on macOS.

    iOS Xcode Configuration

    1. Add the framework to the Xcode project and set the header file import location (the framework file in the GMESDK folder must be added to the project).
    2. Add dependent libraries as shown below:

    Android Configuration

    1. Add gmesdk.jar to the libs library.

    2. Import the so file into Activity as shown below:

      public class AppActivity extends Cocos2dxActivity {
       static final String TAG = "AppActivity";
       static OpensdkGameWrapper gameWrapper ;
       static {
    3. Initialize in the oncreate function exactly in the following sequence:

      protected void onCreate(Bundle savedInstanceState) {
           // Initialize exactly in the following sequence
           gameWrapper = new OpensdkGameWrapper(this);
           runOnGLThread(new Runnable() {
               public void run() {
    4. Configure your project for compilation options by referring to the in the GME Demo for Cocos.

      • Path: GMECocos/GMECocosDemo/
      • Path to the file: /Users/username/Downloads/GMECocos/GMESDK/android/bin/

    Exporting for Different Platforms

    Project configuration is required before you can export executables from the Cocos2d engine for different platforms:

    OS Project Configuration
    Android Android Project Configuration
    iOS iOS Project Configuration
    macOS macOS Project Configuration

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback