0

in my code i am monitoring a socket channels ,but once the code reach this

            server = 
    ServerSocketChannel.open();
            server.configureBlocking(false);
            server.socket().bind(new 
     InetSocketAddress(IpAddress, 4001));

I get this Exception :

        E/AndroidRuntime: FATAL EXCEPTION: Thread-156
               Process: 
   com.example.laptophome.securesys, PID: 5686
              java.lang.NoSuchMethodError: No 
   virtual method 
 bind(Ljava/net/SocketAddress;)Ljava/nio/channels/ServerSocketChannel; in class Ljava/nio/channels/ServerSocketChannel; or its super classes (declaration of 'java.nio.channels.ServerSocketChannel' appears in /system/framework/core-libart.jar)   at 
com.example.laptophome.securesys.Connection.run(Connection.java:53)

can anyone tell what does it mean please ?

  • It says no `bind` method is present. Make sure you are invoking method on correct instance. – jack jay Apr 15 '17 at 16:20
  • The bind method that does not exist according to the exception is part of Android since the very beginning (API 1). Hence this is most likely a problem of the device you use for testing. What device do you use? Have you tested your app on a different device? – Robert Apr 15 '17 at 17:10

0 Answers0