-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.ExceptionInInitializerError On Android 7 #3336
Comments
Can you provide more of the exception? |
I have also encountered this problem: There should be a problem with this line: device name: Samsung Galaxy S7 edge |
I have solve this problem. it caused by mutiDex. If you use Goolge MultiDex. please don't use MultiDex.install().if android sdk > 21 |
my configuration: |
@yuyanghe Thank you for your answer. But my minSdkVersion is 17, What should we do? |
Not sure what action for us to take on this. If there’s a specific bug, please provide an executable test case. |
I know this is an older issue, but I just inherited some legacy code that had this verbatim same issue and I resolved it on my end. The core of the problem is that a NullPointerException is being thrown here:
This is being caused by the need (in this particular call) to allow all Certificates, in which I was using this code to generate the X509TrustManager in the builder:
This is what a large number of StackOverflow posts recommend doing for this situation, but returning null in the getAcceptedIssuers() is why this is occurring. To fix this, simply change the code above to:
I wrote up a StackOverflow Q/A here in case anyone needs to read it: |
Please link to the Stackoverflow question |
Sure, edited and included, thank you for reminding me. |
Hi We use OkHttp3.3.1 in our project. than I found some crash on Some Android 7.
it crash at ConnectionSpec$Builder.tlsVersions.
ths crash log is:
java.lang.ExceptionInInitializerError
at okhttp3.OkHttpClient.(Unknown Source)
at okhttp3.OkHttpClient.y(Unknown Source)
at okhttp3.OkHttpClient$Builder.(Unknown Source)
at com.gf.mobile.common.h.(Unknown Source)
at com.gf.mobile.common.h.b(Unknown Source)
at com.gf.mobile.common.h.a(Unknown Source)
at com.gf.mobile.control.a.l$1.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:776)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'okhttp3.ConnectionSpec$Builder okhttp3.ConnectionSpec$Builder.tlsVersions(okhttp3.TlsVersion[])' on a null object reference
at okhttp3.ConnectionSpec.(Unknown Source)
... 10 more
The text was updated successfully, but these errors were encountered: