Skip to content

Cocos2d-x

This guide explains how to install the Hive SDK in a Cocos2d-x environment.

Android

  1. Download the package from the Hive developer site under Download > Cocos2d-x.
  2. Link the C++ source code files found in the /PluginSource/Android path to your project. Instead of linking the .cpp source code files, you can link the compiled libraries located in the /proj.android/app/jni/hivesdk/lib/c++ path.
  3. Add the following Android libraries to the module-level build.gradle file in your Gradle project.
    dependencies {
    implementation(platform("com.com2us.android.hive:hive-sdk-bom:${project.HIVE_SDK_VERSION}"))
    implementation "com.com2us.android.hive:hive-sdk"
    implementation "com.com2us.android.hive:hive-plugin-java"
    }
    

iOS

To install Cocos2d-x for iOS, first follow the Hive SDK iOS guide for setting up your project Podfile. Then, in the Podfile setup, add the HiveSDKPlugin as shown below.

...

target 'HIVE_SDK_Sample_App' do
   # Add the frameworks to use here. At least one framework is required.
   # Hive SDK C++ language interface plugin framework, required when using Hive SDK Cocos2d-x iOS
   pod 'HiveSDKPlugin', $HIVE_SDK_VERSION
end
...