netty-socketio
netty-socketio copied to clipboard
Cannot run server in android app (inside of a separate service wrapped by a foreground service)
I/System.out: java.lang.ClassNotFoundException: java.lang.management.ManagementFactory
I/System.out: at java.lang.Class.classForName(Native Method)
I/System.out: at java.lang.Class.forName(Class.java:454)
I/System.out: at io.netty.channel.DefaultChannelId.jmxPid(DefaultChannelId.java:135)
I/System.out: at io.netty.channel.DefaultChannelId.defaultProcessId(DefaultChannelId.java:182)
I/System.out: at io.netty.channel.DefaultChannelId.<clinit>(DefaultChannelId.java:77)
I/System.out: at io.netty.channel.DefaultChannelId.newInstance(DefaultChannelId.java:55)
I/System.out: at io.netty.channel.AbstractChannel.newId(AbstractChannel.java:113)
I/System.out: at io.netty.channel.AbstractChannel.<init>(AbstractChannel.java:73)
I/System.out: at io.netty.channel.nio.AbstractNioChannel.<init>(AbstractNioChannel.java:80)
I/System.out: at io.netty.channel.nio.AbstractNioMessageChannel.<init>(AbstractNioMessageChannel.java:42)
I/System.out: at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:96)
I/System.out: at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:89)
I/System.out: at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:82)
I/System.out: at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:75)
I/System.out: at java.lang.reflect.Constructor.newInstance0(Native Method)
I/System.out: at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
I/System.out: at io.netty.channel.ReflectiveChannelFactory.newChannel(ReflectiveChannelFactory.java:44)
I/System.out: at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:310)
I/System.out: at io.netty.bootstrap.AbstractBootstrap.doBind(AbstractBootstrap.java:272)
I/System.out: at io.netty.bootstrap.AbstractBootstrap.bind(AbstractBootstrap.java:268)
I/System.out: at com.corundumstudio.socketio.SocketIOServer.startAsync(SocketIOServer.java:165)
I/System.out: at com.corundumstudio.socketio.SocketIOServer.start(SocketIOServer.java:135)
I/System.out: at com.cloudapp.rtctransport.impl.NettySocketIOSignalingServer.start(NettySocketIOSignalingServer.java:88)
I/System.out: at com.cloudapp.webrtc_demo.P2PScreenCastingService2$1.run(P2PScreenCastingService2.java:113)
I/System.out: at java.lang.Thread.run(Thread.java:919)
I/System.out: Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.management.ManagementFactory" on path: DexPathList[[zip file "/data/app/com.cloudapp.webrtc_demo-BaLxGL0GyB79d3mGNam_GQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.cloudapp.webrtc_demo-BaLxGL0GyB79d3mGNam_GQ==/lib/arm64, /data/app/com.cloudapp.webrtc_demo-BaLxGL0GyB79d3mGNam_GQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]
I/System.out: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
How can i solve this problem?
I tried update netty to 4.1.91-Final, but still not working
api 'org.slf4j:slf4j-simple:1.7.7'