android - pusher-java-client eventQueue inside onCreate -
hi im using pusher notifications, after test keep having troubles, have message when intent load task.
02-08 13:43:56.751 20712-21208/package e/androidruntime: fatal exception: pusher-java-client eventqueue java.lang.noclassdeffounderror: com.pusher.client.connection.websocket.websocketclientwrapper @ com.pusher.client.util.factory.newwebsocketclientwrapper(factory.java:67) @ com.pusher.client.connection.websocket.websocketconnection$1.run(websocketconnection.java:63) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1080) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:573) @ java.lang.thread.run(thread.java:841) this how call pusher connection in oncreate
runonuithread(new runnable() { @override public void run() { // create new pusher instance pusher pusher = new pusher("key"); pusher.connect(new connectioneventlistener() { @override public void onconnectionstatechange(connectionstatechange change) { system.out.println("state changed " + change.getcurrentstate() + " " + change.getpreviousstate()); } @override public void onerror(string message, string code, exception e) { system.out.println("there problem connecting!"); } }, connectionstate.all); channel channel = pusher.subscribe("my-channel"); channel.bind("my-event", new subscriptioneventlistener() { @override public void onevent(string channel, string event, string data) { system.out.println("received event data: " + data); } }); pusher.disconnect(); pusher.connect(); logger.info("hubo un problema al conectarse"); } }); im stuck here, don´t know if im implementing in bad way thread, tips helpful, thanks!
the reason behind error 64k limit in android vm.
fix u should download jar:
http://central.maven.org/maven2/com/pusher/pusher-java-client/1.2.1/pusher-java-client-1.2.1-jar-with-dependencies.jar
add , remove existing java-client-* project dependency.
remove com.google.gson gradle.build file.
finally, enable multidex in project:
https://developer.android.com/studio/build/multidex.html worked me.
Comments
Post a Comment