Log in or register to post comments

UnsatisfiedLinkError when modifying ImageTargets sample

October 12, 2011 - 4:23am #1

[SOLVED]

Hi,

I'm starting a new project from the ImageTargets sample, but I'm having problems when I want to rename the package, functions and so on.
I got the ImageTargets sample working, and then I tried to rename the package in /src and the class names.
I updated the android.mk file with the renamed .cpp files, and then I used javah with the native java functions and copied the generated function headers to the .cpp files (java_com_packageName_class_functionName...).
I also run the ndk-build comand to compile everything, but when I run the app I get the following error on the Log:

No implementation found for native Lcom/packageName/AugmentedRealityActivity;.getOpenGlEsVersionNative ()I;
...
java.lang.UnsatisfiedLinkError: getOpenGlEsVersionNative

Did someone face the same problem? Maybe I forgot something to do?

Thanks,
Infaust.

Re: UnsatisfiedLinkError when modifying ImageTargets sample

November 12, 2011 - 10:19am #4

Did you run "ndk-build" to create the shared libraries? See the Getting Started guide, Step 3.

Try refreshing the Eclipse project after that step. Right-click on the project in the Package Explorer and choose Refresh.

- Kim

Re: UnsatisfiedLinkError when modifying ImageTargets sample

November 12, 2011 - 2:26am #3

hi,

When I'm trying to run the application(imagetargets) for the first time I'm getting the error which you got (UnsatisfiedLinkError). Could you please help me out? My android phone is lg p500 (froyo)

Thanks a lot in advance

Re: UnsatisfiedLinkError when modifying ImageTargets sample

October 12, 2011 - 5:36am #2

Hi,

Ok, I finally solved the problem (it was quite stupid, but it took some time to understand how the NDK and JNI works).
I forgot to edit the LOCAL_MODULE variable in android.mk with the new module.
And I also realised that it's mandatory to refresh the project every time you change something of the JNI stuff (.cpp files, android.mk, etc).

Hope it's useful for someone.

Faust.

Log in or register to post comments