2016-08-23 79 views
1

我的應用程序不斷崩潰。找不到問題出在哪裏。我甚至沒有使用okttp3庫。 目前,我只使用改裝1.9和1.3.8奧托java.lang.NoSuchMethodError - okhttp3(Android)

java.lang.NoSuchMethodError: No virtual method callEnqueue(Lokhttp3/Call;Lokhttp3/Callback;Z)V in class Lokhttp3/internal/Internal; or its super classes (declaration of 'okhttp3.internal.Internal' appears in /data/app/com.myproj.sample-2/base.apk) 
at okhttp3.ws.WebSocketCall.enqueue(WebSocketCall.java:108) 
at io.socket.engineio.client.transports.WebSocket.doOpen(WebSocket.java:73) 
at io.socket.engineio.client.Transport$1.run(Transport.java:75) 
at io.socket.thread.EventThread.exec(EventThread.java:50) 
at io.socket.engineio.client.Transport.open(Transport.java:70) 
at io.socket.engineio.client.Socket.probe(Socket.java:458) 
at io.socket.engineio.client.Socket.onOpen(Socket.java:471) 
at io.socket.engineio.client.Socket.onHandshake(Socket.java:512) 
at io.socket.engineio.client.Socket.onPacket(Socket.java:485) 
at io.socket.engineio.client.Socket.access$900(Socket.java:30) 
at io.socket.engineio.client.Socket$5.call(Socket.java:299) 
at io.socket.emitter.Emitter.emit(Emitter.java:117) 
at io.socket.engineio.client.Transport.onPacket(Transport.java:127) 
at io.socket.engineio.client.transports.Polling$2.call(Polling.java:124) 
at io.socket.engineio.parser.Parser.decodePayload(Parser.java:251) 
at io.socket.engineio.client.transports.Polling._onData(Polling.java:134) 
at io.socket.engineio.client.transports.Polling.onData(Polling.java:106) 
at io.socket.engineio.client.transports.PollingXHR$5$1.run(PollingXHR.java:113) 
at io.socket.thread.EventThread$2.run(EventThread.java:75) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818) 
+0

改造似乎取決於okhttp:參見[改裝的pom.xml(https://repo1.maven.org/maven2/com/squareup/retrofit/retrofit/1.9.0/retrofit-1.9。 0.pom) – ymonad

+0

@ymonad好的,那麼對於這個問題可能有什麼解決方案。我無法弄清楚。 – Abhilash

回答

1

this後幫助解決它。

只需將以下內容添加到您的gradle dependecies中即可。

compile 'com.squareup.okhttp3:okhttp:3.4.1' 
compile 'com.squareup.okhttp3:okhttp-ws:3.4.1' 
相關問題