Measure Twice, Byte Once Making Stuff

19Jan/120

Android NativeActivity JNI and ClassNotFoundException

We're working on some code related to the Android NDK and using JNI to call Java methods from C/C++. This site has some great code + explanation on how to access your custom Java classes. If you still get ClassNotFoundExceptions after implementing that code, and you've tried everything you can think of, double-check your AndroidManifest.xml for the application attribute android:hasCode="false".

Some of the NDK samples include this setting, which will cause your Java code to be left out of the final APK.