Home › Forums › Legacy SDKs › Getting started with GazeSDK: Linking error
Tagged: gaze sdk UnsatisfiedLinkError
- This topic has 3 replies, 2 voices, and was last updated 8 years, 6 months ago by Grant [Tobii].
- AuthorPosts
- 15/04/2016 at 01:12 #5025marParticipant
I am trying to run any Gaze SDK function calls on a new Android app, and I get a linking error, though it appears my call to
System.loadLibrary("tobiigazecore-jni")
does not raise an error:java.lang.UnsatisfiedLinkError: No implementation found for void com.tobii.gaze.core.TobiiGazeCoreModuleJNI.swig_module_init() (tried Java_com_tobii_gaze_core_TobiiGazeCoreModuleJNI_swig_1module_1init and Java_com_tobii_gaze_core_TobiiGazeCoreModuleJNI_swig_1module_1init__)
This is the short code I’m trying to run:
System.loadLibrary("tobiigazecore-jni"); try { String url = Discovery.getConnectedEyeTracker(); return url; } catch (EyeTrackerException e) { Log.e(TAG, "getConnectedEyeTrackerUrl failed with error code " + e.errorCode()); }
Can anyone advise me on how to troubleshoot? Or is there something obvious I should be doing which I’m not doing?
I’ve run
nm -C
on the.so
file, andgrep
‘ed it for the keywordswig
to get the following:0005e22d T Java_com_tobii_gaze_core_TobiiGazeCoreModuleJNI_swig_1module_1init 00059dcd T SwigDirector_EyeTrackerCallbackHandler::swig_connect_director(_JNIEnv*, _jobject*, _jclass*, bool, bool) 000e42f8 d Java_com_tobii_gaze_core_TobiiGazeCoreModuleJNI_swig_1module_1init::methods 000e9010 d SwigDirector_EyeTrackerCallbackHandler::swig_connect_director(_JNIEnv*, _jobject*, _jclass*, bool, bool)::methods 000e91b0 b SwigDirector_EyeTrackerCallbackHandler::swig_connect_director(_JNIEnv*, _jobject*, _jclass*, bool, bool)::baseclass
There appears to be a match. If that’s the case, why does the call to
loadLibrary
appear to succeed but the search forJava_com_tobii_gaze_core_TobiiGazeCoreModuleJNI_swig_1module_1init
appear to fail?18/04/2016 at 09:36 #5048Grant [Tobii]KeymasterHi @marr,
Whilst the method is there, it is not supported for the android platform… perhaps you can try to explain what you are trying to do and we can go from there?
18/04/2016 at 21:33 #5055marParticipant@Grant, at this point, I’m just trying to familiarize myself with the interface, but ultimately, I would like to read gaze position data from a connected Android device every 20th of a second or so.
I believe that in order to do that, I need to:
- instantiate an
EyeTracker
with the REX’s URL - set a callback handler on the tracker
- establish a connection to the REX
I wished to use
Discovery.getConnectedEyeTracker
so that I could avoid requiring user input or a hardcoded URL to instantiate theEyeTracker
, but if I have understood you, this is not an option on Android.So I have modified my inchoate code to try
new EyeTracker("tobii-ttp://REXDL-030114044623")
, but my app still crashes as soon as I run the relevant code. I get an unsatisfied link error, just as in my original post. Here is the more lengthy error from the log:04-18 12:30:47.348 32282 32282 E AndroidRuntime: FATAL EXCEPTION: main 04-18 12:30:47.348 32282 32282 E AndroidRuntime: Process: edu.ucdavis.auditoryenhancer, PID: 32282 04-18 12:30:47.348 32282 32282 E AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for void com.tobii.gaze.core.TobiiGazeCoreModuleJNI.swig_module_init() (tried Java_com_tobii_gaze_core_TobiiGazeCoreModuleJNI_swig_1module_1init and Java_com_tobii_gaze_core_TobiiGazeCoreModuleJNI_swig_1module_1init__) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at com.tobii.gaze.core.TobiiGazeCoreModuleJNI.swig_module_init(Native Method) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at com.tobii.gaze.core.TobiiGazeCoreModuleJNI.<clinit>(TobiiGazeCoreModuleJNI.java:535) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at com.tobii.gaze.core.EyeTracker.<init>(EyeTracker.java:39) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at edu.ucdavis.auditoryenhancer.eyetracker.EyeTrackerActivity.onCreate(EyeTrackerActivity.java:33) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6237) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 04-18 12:30:47.348 32282 32282 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I’m sorry. It looks like I’m not linking the gaze library correctly. Here’s how I set up the
libtobiigazecore-jni
module, which I try to load with a call toSystem.loadLibrary("libtobiigazecore-jni")
:include $(CLEAR_VARS) LOCAL_MODULE := libtobiigazecore-jni LOCAL_SRC_FILES := ../libs/Tobii/TobiiGazeSdk-JavaApi-1.0.0.86-android-armeabi-v7a/armeabi-v7a/libtobiigazecore-jni.so include $(BUILD_SHARED_LIBRARY)
02/05/2016 at 14:19 #5135Grant [Tobii]KeymasterHi @marr,
Thanks for the clarifying that you are using the Rex Device. This is rather an old (and now deprecated) eye tracker so we can only recommend using the version of the Gaze SDK that comes with the device.
That being said, can you clarify if the standard Android sample is able to be built and ran?
- instantiate an
- AuthorPosts
- You must be logged in to reply to this topic.