Android Emulator Workaround

Here is a small tip if you are having trouble running the Android Emulator for code that calls native methods and getting an error message similar to this:

The simple workaround is to add the following to the onCreate method of your main activity:

This way the classloader is “forced” to load ByteBuffer. This is not needed when running on a device, only the emulator as it seems.

Leave a Reply

Your email address will not be published. Required fields are marked *