Revision history [back]

click to hide/show revision 1
initial version

Creating BusListener throws UnsatisfiedLinkError

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)

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.