androidjava-native-interfacecmusphinx

Changing package name breaks JNI


I try to use the pocketsphinx package for my app and need to rename the demo package name to something usefull (eg com.myname.foo)

I spent hours on figuring out, but I simply can't get it to work.

The problem is, that the project runs fine if I leave the package name and works without any problems (apart from random crashes), but when I rename it, i get the error

FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: new_Config__SWIG_0

I already tried modifying the Swig command, but it didn't work either.

Any ideas?

I only changed the Manifest's package name declariation and the package folder of the normal Activity.


Solution

  • Sooo, I found the problem; I spend 20 ****ing hours just to find out, that I actually forgot to add

    static {
        System.loadLibrary("pocketsphinx_jni");
    }
    

    to the Activity class. I can't believe I didn't see that, but thanks for all the answers! +1 for everyone helping me :]