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.

java.lang.NullPointerException throw with null exception

See original GitHub issue

error stack:

1 java.net.Socket.getInputStream(Socket.java:894)
2 okio.Okio.okio.Source source(java.net.Socket)(Okio.java:220)
3 okhttp3.internal.connection.RealConnection.void connectSocket(int,int)(RealConnection.java:226)
4 okhttp3.internal.connection.RealConnection.void connect(int,int,int,boolean)(RealConnection.java:146)
5 okhttp3.internal.connection.StreamAllocation.okhttp3.internal.connection.RealConnection findConnection(int,int,int,boolean)(StreamAllocation.java:186)
6 okhttp3.internal.connection.StreamAllocation.okhttp3.internal.connection.RealConnection findHealthyConnection(int,int,int,boolean,boolean)(StreamAllocation.java:121)
7 okhttp3.internal.connection.StreamAllocation.okhttp3.internal.http.HttpCodec newStream(okhttp3.OkHttpClient,boolean)(StreamAllocation.java:100)
8 okhttp3.internal.connection.ConnectInterceptor.okhttp3.Response intercept(okhttp3.Interceptor$Chain)(ConnectInterceptor.java:42)
9 okhttp3.internal.http.RealInterceptorChain.okhttp3.Response proceed(okhttp3.Request,okhttp3.internal.connection.StreamAllocation,okhttp3.internal.http.HttpCodec,okhttp3.Connection)(RealInterceptorChain.java:92)
10 okhttp3.internal.http.RealInterceptorChain.okhttp3.Response proceed(okhttp3.Request)(RealInterceptorChain.java:67)
11 okhttp3.internal.cache.CacheInterceptor.okhttp3.Response intercept(okhttp3.Interceptor$Chain)(CacheInterceptor.java:93)
12 okhttp3.internal.http.RealInterceptorChain.okhttp3.Response proceed(okhttp3.Request,okhttp3.internal.connection.StreamAllocation,okhttp3.internal.http.HttpCodec,okhttp3.Connection)(RealInterceptorChain.java:92)
13 okhttp3.internal.http.RealInterceptorChain.okhttp3.Response proceed(okhttp3.Request)(RealInterceptorChain.java:67)
14 okhttp3.internal.http.BridgeInterceptor.okhttp3.Response intercept(okhttp3.Interceptor$Chain)(BridgeInterceptor.java:93)
15 okhttp3.internal.http.RealInterceptorChain.okhttp3.Response proceed(okhttp3.Request,okhttp3.internal.connection.StreamAllocation,okhttp3.internal.http.HttpCodec,okhttp3.Connection)(RealInterceptorChain.java:92)
16 okhttp3.internal.http.RetryAndFollowUpInterceptor.okhttp3.Response intercept(okhttp3.Interceptor$Chain)(RetryAndFollowUpInterceptor.java:120)
17 okhttp3.internal.http.RealInterceptorChain.okhttp3.Response proceed(okhttp3.Request,okhttp3.internal.connection.StreamAllocation,okhttp3.internal.http.HttpCodec,okhttp3.Connection)(RealInterceptorChain.java:92)
18 okhttp3.internal.http.RealInterceptorChain.okhttp3.Response proceed(okhttp3.Request)(RealInterceptorChain.java:67)
19 okhttp3.RealCall.okhttp3.Response getResponseWithInterceptorChain()(RealCall.java:179)
20 okhttp3.RealCall$AsyncCall.void execute()(RealCall.java:129)
21 okhttp3.internal.NamedRunnable.void run()(NamedRunnable.java:32)
22 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
23 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
24 java.lang.Thread.run(Thread.java:761)

environ: Android 7.0 samsung SM-G9350 , xiaomi mi5 Android 7.0 and other android 7.0.

okhttp3,3.6.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
liujigangcommented, Apr 6, 2017

2017-04-06 11-47-04

tracking this bug a week(about 2,004 user crash), most crash at huawei phone,other is samsung,xiaomi , all in android 7.0 .

2reactions
15characterlimicommented, Apr 15, 2017

This is a known bug in Android 7.0; it was fixed by this change which went into Android 7.1:

https://android-review.googlesource.com/#/c/271775/

I’m very sorry that we found it too late for Android 7.0 and that you ran into it.

The issue is that Android 7.0’s PrivilegedActionException.getException() returns null, so places that do:

throw privilegedActionException.getException()

will attempt to throw a null value. There are 19 such places in Android N; sadly, this is one of them. 😦 I plan to take appropriate measures to make vendors aware of this issue and the patch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fatal Exception: java.lang.NullPointerException in release build
It means, that when you calling getter of minAllowedVersion field and its returns null - you caught NPE. Try to use null-safety and...
Read more >
How to resolve the java.lang.NullPointerException - Educative.io
In Java, the java.lang.NullPointerException is thrown when a reference variable is accessed (or de-referenced) and is not pointing to any object.
Read more >
How to Fix and Avoid NullPointerException in Java - Rollbar
The NullPointerException occurs due to a situation in application code where an uninitialized object is attempted to be accessed or modified.
Read more >
java.lang.NullPointerException: throw with null exception ...
java. lang. NullPointerException: throw with null exception - Exception for release apks with progaurd enabled. Issue #826 · AzureAD/microsoft- ...
Read more >
Null Pointer Exception In Java - GeeksforGeeks
NullPointerException is thrown when program attempts to use an object reference that has the null value.
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