This is the native 'tealeaf' platform for android devices
-
Install android tools, then download and unpack android-ndk-r18b
-
Export path: export ANDROID_HOME=/home/USERNAME/Android/Sdk export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools export PATH=$PATH:/YOUR_PATH_TO/android-ndk-r18b
-
Install and configure NDK tools with installed SDK Manger (see 1)
Debugging with specific sgning keys might be required by some APIs and plugins or sign release build just:
- set up environment variables and use:
export DEVKIT_ANDROID_KEYSTORE_PATH='path/to/your/keystore'
export DEVKIT_ANDROID_KEYSTORE_PASSWORD='your keystore pass'
export DEVKIT_ANDROID_ALIAS_PASSWORD='your alias pass'
export DEVKIT_ANDROID_ALIAS_NAME='you alias name'
- Sign apk
To debug with specific keys
devkit debug native-android --signing true
For release apkdevkit release native-android
For release bundle (aab)devkit release native-android bundle
Do not update barista submodule. Current source code requires specific commit f2356f0
description:
do: touch ~/.android/repositories.cfg and install required sdk with sdkmanager or install required sdk with Android Studio
AttributeError: 'NoneType' object has no attribute 'groups'
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
do:
- Make sure you select correct Xcode.app path with
xcode-select -print-path
- Point xcode-select to the Xcode Developer directory using the following command
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
More at nodejs/node-gyp#569
#After you have made some changes in native-android go to devkit-core repositoty updated native-android submodule:
- git submodule update --init --force --remote
- git add .
- git commit -m "updates of native-android"
- git push origin YOURBRANCH
Next plugins are made as Gradle library projects and can be edited in Android Studio:
Gameplay
Gamecircle
Facebook
Please note that these plugins library projects are not imported as project modules, instead they are imported as AAR (Android archive) which contain necessary source code and resources. You can see this in android/config.json of each library project plugin This requires to rebuild .aar file after plugin source code has been modified with proces: Import project into Android Studio -> Add changes -> Build -> Rebuild project. This will rebuild .aar file, the path to which is already in config.json.
Disable instant run feature in Android Studio
To modify or debug native code it is necessary to delete folder AndroidSeed/tealeaf/src/main/libs/
with its content and to build game in debug mode
In order to save building time, NDK building is skipped if there are precompiled shared libraries libtealeaf.so
exist at path AndroidSeed/tealeaf/src/main/libs/
and these libraries correspond to list of abis enumerated in APP_ABI parameter in file AndroidSeed/tealeaf/src/main/jni/Application.mk
By default there are armeabi-v7a and arm64-v8a precompiled libraries exist at path AndroidSeed/tealeaf/src/main/libs/
and are enumerated in file AndroidSeed/tealeaf/src/main/jni/Application.mk
. The libraries are built in release mode so no changes required for games or plugins development.
1 open chrome://inspect/#devices
in Crhome
2 make sure you can see your connected device
3 run debug in Android Studio
4 open url which will appear as soon as you will see hashcube splashscreen
5 wait for debugger to stop with debugger;
command or add it in application json
6 set your breakpoints