-
Notifications
You must be signed in to change notification settings - Fork 45
Troubleshooting MWEngine
This page documents the most commonly asked questions when working with MWEngine
Note: The repository contents should always trigger a stable build. First ensure you have followed all the steps in the README.md file with regards to dependencies and configuration.
This implies that the native layer code has not been built or that SWIG wrapping has failed. The contents of this folder are under .gitignore and should always be generated.
There is a known issue where after successfully building the native layer code, Android Studio does not recognize the generated files as classes (note that builds and deployments should work at this point). Simply close and reopen the project window and all should be fine. If that should still fail, navigate to the /java/nl/igorski/mwengine/core/-folder in the Project panel, right click the folder and Unmark this directory as sources root using the Mark directory as submenu.
If the application crashes when starting and there are no log messages coming from AndroidRuntime, it's a native crash. You can find the cause of the issue by using the following command:
adb logcat | ndk-stack -sym obj/local/{ARCHITECTURE}
where {ARCHITECTURE} can be replaced with the CPU architecture of the device/VM you are testing on. This command will relate the origin of the crash to the source code (giving you class name and line number).
If this fails you can do a logcat search for messages coming from "mwengine" (showing the native library name), this might show you something like:
W/System.err: mwengine native code library failed to load.
W/System.err: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memclr4" referenced by "/data/app/nl.igorski.example-2/lib/arm/libmwengine.so"...
where the above indicates that the device/VM that is being tested on has a lower version of Android than supported (for instance using android-26 as the NDK compile target will result in code not compatible on devices running OS versions lower than Android 8).
The default MWEngineActivity uses logtag "MWENGINE", this is also the same log tag as used in the library (see global.h). You can use the logcat filter "D/MWENGINE" to filter out the messages from the Java side of the application, and "V/MWENGINE" to filter out the messages from the native layer.