question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Caused by: java.lang.IllegalArgumentException: byteCount < 0: -1

See original GitHub issue

error stack

java.lang.reflect.UndeclaredThrowableException
                                                                          at $Proxy2.intercept(Unknown Source)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                          at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                          at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                          at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                          at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                          at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:145)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
                                                                          at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
                                                                          at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
                                                                          at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                                                                          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)
                                                                       Caused by: java.lang.reflect.InvocationTargetException
                                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                                          at com.android.tools.profiler.support.network.OkHttpInterceptorHandler.trackResponseBody(OkHttpInterceptorHandler.java:58)
                                                                          at com.android.tools.profiler.support.network.OkHttpInterceptorHandler.invoke(OkHttpInterceptorHandler.java:39)
                                                                          at java.lang.reflect.Proxy.invoke(Proxy.java:393)
                                                                          at $Proxy2.intercept(Unknown Source) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
                                                                          at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
                                                                          at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
                                                                          at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:145) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
                                                                          at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185) 
                                                                          at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135) 
                                                                          at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) 
                                                                          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) 
                                                                       Caused by: java.lang.IllegalArgumentException: byteCount < 0: -1
                                                                          at okio.RealBufferedSource.request(RealBufferedSource.java:64)
                                                                          at java.lang.reflect.Method.invoke(Native Method) 
                                                                          at com.android.tools.profiler.support.network.OkHttpInterceptorHandler.trackResponseBody(OkHttpInterceptorHandler.java:58) 
                                                                          at com.android.tools.profiler.support.network.OkHttpInterceptorHandler.invoke(OkHttpInterceptorHandler.java:39) 
                                                                          at java.lang.reflect.Proxy.invoke(Proxy.java:393) 
                                                                          at $Proxy2.intercept(Unknown Source) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
                                                                          at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
                                                                          at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
                                                                          at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:145) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) 
                                                                          at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) 
                                                                          at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185) 
                                                                          at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135) 
                                                                          at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) 
                                                                          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) 

gradle : com.android.tools.build:gradle:2.4.0-alpha7 okhttp version: 3.8.0 make post http request. url: http://106.14.57.254/v1/postSms field: “phone”:“18200389404”

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
ncapdevicommented, May 18, 2017

@lujop I was able to fix it by going into my Run/Debug Configuration > Profiling, and disabling the Enable Advanced Profiling

0reactions
swankjessecommented, Jun 11, 2017

The previous comment has the workaround. No further action for us to take on this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android java.lang.IllegalArgumentException: byteCount
I get random error (not all connection) java.lang.IllegalArgumentException: byteCount < 0: -291674 from ...
Read more >
java.lang.IllegalArgumentException: byteCount < 0: -1 - 异常分析
又是一年中秋佳节,祝各位中秋节快乐。 今天我们来聊聊这个最近很火的网络请求库retrofit,在此基础上会延伸出一...
Read more >
FramedStream.java - Google Git
import java.util. ... boolean streamIsClient = ((id & 1) == 1); ... if (byteCount < 0) throw new IllegalArgumentException("byteCount < 0: " +...
Read more >
Buffer.java - Android Code Search
* Returns an immutable copy of the first {@code byteCount} bytes of this buffer as a byte string. */. public ByteString snapshot( ...
Read more >
java.lang.IllegalArgumentException: Multiple entries with ...
5.1.1. Android Plugin Version: 3.4.0. Module Compile Sdk Version: ... 26.1.1. Updated to Android Studio 3.4, com.android.tools.build:gradle:3.4.0, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found