Forum Multiplayer Android Client crashes on setDevelopmentServer()

Discussion and help relating to the PlayerIO Multiplayer API.

Android Client crashes on setDevelopmentServer()

Postby EvermoreGaming » May 23rd, 2018, 4:05 am

I'm pretty sure I'm not doing anything wrong, but Android Studio and the app crash on the line
Code: Select all
client.multiplayer.setDevelopmentServer(new ServerEndpoint("192.168.1.64", 8184));


This is my log:
E/AndroidRuntime: FATAL EXCEPTION: pool-2-thread-2
Process: com.poskus.games.jvocab, PID: 16762
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
at com.playerio.Multiplayer$3.onSuccess(Multiplayer.java:167)
at com.playerio.Multiplayer$3.onSuccess(Multiplayer.java:164)
at com.playerio.PlayerIOChannelProtobufHttp$1.run(PlayerIOChannelProtobufHttp.java:76)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

I'm running on a older physical device, Samsung Galaxy Grand Prime.
EvermoreGaming
 
Posts: 8
Joined: September 2nd, 2012, 3:05 am

Re: Android Client crashes on setDevelopmentServer()

Postby EvermoreGaming » May 23rd, 2018, 4:19 am

It seems to actually be happening when I call createJoinRoom AND have setDevelopmentServer().

Edit: I can upload the dll and connect fine to live servers. It has an issue with the array of endpoints you pass to your createJoinRoom success callback.

Code: Select all
client.multiplayer.createJoinRoom(
                null,
                "race",
                true,
                null,
                null,
                new Callback<Connection>() {
                    public void onSuccess(Connection connection) {
                        Log.d(TAG, "Connected to room successfully");
                        //Success!
                        connection.addMessageListener("*", new MessageListener() {
                            public void onMessage(Message message) {
                                String messageType = message.getType();
                                if (messageType.equals("timeLife")) timeLeft(message);
                                if (messageType.equals("addAvatars")) addAvatars(message);
                            }
                        });
//                        connection.addDisconnectListener("*", new DisconnectListener() {
//                            public void onDisconnect() {
//                                //Disconnected from room...
//                            }
//                        });
                    }
                    public void onError(PlayerIOError error) {
                        //Error connecting
                        Log.d(TAG, error.toString());
                    }
                }
EvermoreGaming
 
Posts: 8
Joined: September 2nd, 2012, 3:05 am

Re: Android Client crashes on setDevelopmentServer()

Postby EvermoreGaming » May 24th, 2018, 11:20 pm

I don't mean to be a pain, but I am curious if this issue is known to the developers and if there is any fix on the horizon. I would like to stick with PlayerIO, but may need to switch to another service if I can't get this working.

Thank you for your time and any advice would be appreciated. If you have any questions you need answered that would help resolve this issue, I am 100% willing to help.
EvermoreGaming
 
Posts: 8
Joined: September 2nd, 2012, 3:05 am

Re: Android Client crashes on setDevelopmentServer()

Postby Henrik » June 9th, 2018, 4:28 am

Hey EvermoreGaming,

Thank you so much for your bug report! We've fixed the issue and made a new release of the Android client libraries, so just download the PlayerIO SDK and grab the updated .aar.

Please let us know if you have any more issues with the SDK.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Android Client crashes on setDevelopmentServer()

Postby EvermoreGaming » June 15th, 2018, 5:16 am

That's great news! Thank you. :)
EvermoreGaming
 
Posts: 8
Joined: September 2nd, 2012, 3:05 am


Return to Multiplayer



cron