0

Creating BusListener throws UnsatisfiedLinkError

asked 2015-01-29 20:29:51 -0800

moorej12 gravatar image

I am just trying out alljoyn on android. I have been following the chat sample pretty closely and am just trying to see if I can get devices to find each other for now. I am getting the following error when instantiating the BusListener object though:

01-29 21:22:06.700: E/AndroidRuntime(27429): FATAL EXCEPTION: main 01-29 21:22:06.700: E/AndroidRuntime(27429): Process: io.playtime.connect, PID: 27429 01-29 21:22:06.700: E/AndroidRuntime(27429): java.lang.UnsatisfiedLinkError: Native method not found: org.alljoyn.bus.BusListener.create:()V 01-29 21:22:06.700: E/AndroidRuntime(27429): at org.alljoyn.bus.BusListener.create(Native Method) 01-29 21:22:06.700: E/AndroidRuntime(27429): at org.alljoyn.bus.BusListener.<init>(BusListener.java:63) 01-29 21:22:06.700: E/AndroidRuntime(27429): at io.playtime.connect.services.connection.ConnectionService$ConnectBusListener.<init>(ConnectionService.java:824) 01-29 21:22:06.700: E/AndroidRuntime(27429): at io.playtime.connect.services.connection.ConnectionService$ConnectBusListener.<init>(ConnectionService.java:824) 01-29 21:22:06.700: E/AndroidRuntime(27429): at io.playtime.connect.services.connection.ConnectionService.<init>(ConnectionService.java:780) 01-29 21:22:06.700: E/AndroidRuntime(27429): at java.lang.Class.newInstanceImpl(Native Method) 01-29 21:22:06.700: E/AndroidRuntime(27429): at java.lang.Class.newInstance(Class.java:1208) 01-29 21:22:06.700: E/AndroidRuntime(27429): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2567) 01-29 21:22:06.700: E/AndroidRuntime(27429): at android.app.ActivityThread.access$1800(ActivityThread.java:139) 01-29 21:22:06.700: E/AndroidRuntime(27429): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292) 01-29 21:22:06.700: E/AndroidRuntime(27429): at android.os.Handler.dispatchMessage(Handler.java:102) 01-29 21:22:06.700: E/AndroidRuntime(27429): at android.os.Looper.loop(Looper.java:136) 01-29 21:22:06.700: E/AndroidRuntime(27429): at android.app.ActivityThread.main(ActivityThread.java:5086) 01-29 21:22:06.700: E/AndroidRuntime(27429): at java.lang.reflect.Method.invokeNative(Native Method) 01-29 21:22:06.700: E/AndroidRuntime(27429): at java.lang.reflect.Method.invoke(Method.java:515) 01-29 21:22:06.700: E/AndroidRuntime(27429): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 01-29 21:22:06.700: E/AndroidRuntime(27429): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 01-29 21:22:06.700: E/AndroidRuntime(27429): at dalvik.system.NativeStart.main(Native Method)</init></init></init></init>

My BusListener Object is as follows:

private class ConnectBusListener extends BusListener {
    public void foundAdvertisedName(String name, short transport, String namePrefix) {
        Log.d(TAG, "found " + name);
    }

    public void lostAdvertisedName(String name, short transport, String namePrefix) {
        Log.d(TAG, "Lost " + name);
    }
}

and it is instantiated by

private ConnectBusListener mBusListener = new ConnectBusListener();

I am not sure what I am doing wrong as this seems to be the same as what is in the Chat sample, but the sample works fine and my app crashes.

edit retag flag offensive close merge delete

Comments

Totally missed that line of code. That was what I was missing. Thanks!

moorej12 ( 2015-01-31 11:17:12 -0800 )edit

I converted my earlier comment in an answer since it solved your problem. You could mark it as correct answer if it completely solved your problem

Nikhil Dabhade ( 2015-02-02 13:12:24 -0800 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-01-30 16:26:36 -0800

Nikhil Dabhade gravatar image

updated 2015-01-30 16:26:46 -0800

Do have this call in place ? /* Load the native alljoyn_java library. */ static { System.loadLibrary("alljoyn_java"); }

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-01-29 20:29:51 -0800

Seen: 103 times

Last updated: Jan 29 '15