parse-community/ParseLiveQuery-Android

InstantiationError

reaurr opened this issue · 1 comments

Hi,
When I try to run app, logcat give this err :

 java.lang.InstantiationError: okhttp3.internal.ws.RealWebSocket
                                                              at okhttp3.OkHttpClient.newWebSocket(OkHttpClient.java:414)
                                                              at com.parse.OkHttp3SocketClientFactory$OkHttp3WebSocketClient.open(OkHttp3SocketClientFactory.java:90)
                                                              at com.parse.ParseLiveQueryClientImpl.reconnect(ParseLiveQueryClientImpl.java:157)
                                                              at com.parse.ParseLiveQueryClientImpl.connectIfNeeded(ParseLiveQueryClientImpl.java:115)
                                                              at com.test.MainApp.onCreate(MainApp.java:31)

The cause of error : parseLiveQueryClient.connectIfNeeded();

I have internet permission.
My inits:

Parse.initialize(...................);
   try {
            ParseLiveQueryClient parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient(new URI("ws://192.168.1.2:1337"));
parseLiveQueryClient.connectIfNeeded();

// or ParseLiveQueryClient parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient();
// parseLiveQueryClient.connectIfNeeded();

    
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }

Solve it. The reason is the library conflict. I use both of this lib and TGIO lib. After delete from gradle, it works.