2

Crashlytics report for my android app shows that a considerable number of my users are getting the following null pointer exception. Most of my users who get this error are on Android 6. It happens only when the build is obfuscated.

The crash is caused by a call to,

org.stellar.sdk.Server(String uri)

How do I fix this? Any help would be appreciated.

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 
 'java.util.Enumeration java.security.KeyStore.aliases()' on a null object reference
 at com.android.org.conscrypt.TrustManagerImpl.acceptedIssuers(TrustManagerImpl.java:185)
 at com.android.org.conscrypt.TrustManagerImpl.getAcceptedIssuers(TrustManagerImpl.java:603)
 at shadow.okhttp3.internal.platform.Platform.buildTrustRootIndex(Platform.java)
 at shadow.okhttp3.internal.platform.Platform.afterHandshake(Platform.java)
 at shadow.okhttp3.internal.tls.CertificateChainCleaner.get(CertificateChainCleaner.java:8)
 at shadow.okhttp3.OkHttpClient.<init>(OkHttpClient.java:8)
 at shadow.okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:7)
 at org.stellar.sdk.Server.<init>(Server.java:7)
 at com.myapp.MyStellarManager.<clinit>(MyStellarManager.java)
 at com.myapp.MainVM$observableData$1.invokeSuspend(MainVM.java:2)
 at kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(Intrinsics.java)
 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:2)
 at kotlinx.coroutines.scheduling.CoroutineScheduler.access$getCorePoolSize$p(CoroutineScheduler.java)
 at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.java:18)
 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:18)
Tony
  • 2,242
  • 22
  • 33
  • 1
    What version of Android? What devices? [Shadow appears to be using OkHttp 3.11.0](https://github.com/stellar/java-stellar-sdk/blob/master/build.gradle), which is kinda old. Perhaps this was fixed in one of the later versions. If you're feeling fancy you can fork the repo and update the version to 3.12.10. – Eugen Pechanec Mar 11 '20 at 19:53

0 Answers0