This project use google game sdk source code. Current dependency info:
- You can download from github.
- Branch: android-games-sdk-release
- CommitID: 551ee6b30de541fabceb8424abfb3818b5037283
-
Copy 'GameActivity', 'GameController', 'GameTextInput' and 'src/extras' directories from cloned directories.
-
First, modify cpp files and CMakeLists.txt, and then copy these files to the directory 'sources/Android-gamesdk' in the GIT repository
-
Modify onCreate function of GameActivity
String libname = "main"; // following code is needed to be added if (null != getIntent().getStringExtra(META_DATA_LIB_NAME)) { libname = getIntent().getStringExtra(META_DATA_LIB_NAME); }
- Use gradle command. gradlew :lib-game-sdk::assembleRelease
- Copy classes.jar from the 'lib-game-sdk/build/intermediates/aar_main_jar/release' directory to the 'native\cocos\platform\android\java\libs' directory of the git repository
- rename classes.jar to game-sdk.jar
- JAVA_HOME configuration to jdk11 can not be higher than jdk14, start a new command line window and make sure that the Java version number is the set JDK version. You may need to put $JAVA_HOME/bin to the system variable path.