FolioReader / FolioReader-Android

A Java ePub reader and parser framework for Android.
BSD 3-Clause "New" or "Revised" License
2.25k stars 716 forks source link

Fatal Exception: kotlin.KotlinNullPointerException when webView (or Chrome) is old #376

Open cezaryjurkiweicz opened 5 years ago

cezaryjurkiweicz commented 5 years ago

Android SDK - 7.0, 7.1.1 Crash / Error -

Fatal Exception: kotlin.KotlinNullPointerException
       at com.folioreader.ui.fragment.FolioPageFragment$webViewClient$1.onPageFinished(FolioPageFragment.java)
       at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:545)
       at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:201)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6119)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Steps to reproduce / Describe in detail - Change to night mode

cezaryjurkiweicz commented 5 years ago

I foud that this problem is when webview or chrome is not new

onatakduman commented 5 years ago

I have the same issue too, that crashes the app at release variant.

ashokkumar88 commented 4 years ago

@onatakduman did you find any solution?

ab406 commented 3 years ago

I has also the same issue and it happened when I implement folioReader.setReadLocator(readLocator) where readLocator was null, After I added null check the problem was solved. If you are using setReadLocatorListener in your code it is triggered when you are opening the book and for the first time you are opening the book since there is no saved readLocator it comes null.