To include the shared library in the APK, you will need to edit either compile_settings_android_armv7.py or compile_settings_android_armv8.py from <engine_root>/Tools/build/waf-1.7.13/lmbrwaflib depending on your target device.
The following code template should probably only be included in the debug and profile variant functions within the above files but could be applied to the common_settings function if desired:
conf.env['EXT_LIBS'] += [
conf.add_to_android_cache(os.path.join(<path_to_mali_install>, 'target', 'android', 'arm', 'unrooted', <architecture>, 'libMGD.so'))
- ‘armeabi-v7a’ for armv7
- ‘arm64-v8a’ for armv8
NOTE: The paths to the libraries is based off the latest version of the debugger, 5.1.0, and may be different if using another version.
Now to load the library, the try/catch code you mentioned will need to be added inside the static block of <engine_root>/Code/Launcher/AndroidLauncher/ProjectBuilder/ProjectActivity.java
Log.d("LMBR", "BootStrap: Starting Library load");
Log.i("LMBR", "libMGD.so not loaded.");
Log.d("LMBR", "BootStrap: Finished Library load");
After making these edits, run the configure WAF command and rebuild.