it takes too long to load a epub from assets + when you press light/night mode or try any other features it crashs. -
Platform (android) -
Crash / Error -
1.downloaded the codes(comment everything thats not related to "load from assets") note: had some issues and started to fix them one by one. 2.put assets in lib folder 3.write lib/assets/book.epub in both pubspec.yaml and in code (it doesn
t even open the file otherwise)
here the content of debug console when i scroll in epub:
Launching lib\main.dart on G011A in debug mode...
lib\main.dart
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:64818/aEB2GFdRzio=/ws
W/Java7Support( 4485): Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added
I/SavedLocation( 4485): -> savedLocation ->
W/art ( 4485): Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
V/FolioActivity( 4485): -> initDistractionFreeMode
V/FolioActivity( 4485): -> hideSystemUI
V/FolioActivity( 4485): -> showSystemUI
I/art ( 4485): Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
V/FolioActivity( 4485): -> setNightMode
V/FolioActivity( 4485): -> initMediaController
V/FolioActivity( 4485): -> setupBook
V/FolioActivity( 4485): -> initBook
D/AppUtil ( 4485): -> getAvailablePortNumber -> portNumber 8080 available
V/FolioActivity( 4485): -> onPostCreate
V/FolioActivity( 4485): -> onResume
V/FolioAppBarLayout( 4485): -> onApplyWindowInsets
I/System.out( 4485): Failed to create TextToSpeech
I/art ( 4485): Rejecting re-init on previously-failed class java.lang.Class<com.folioreader.ui.view.FolioWebView$TextSelectionCb2>
I/WebViewFactory( 4485): Loading com.android.webview version 52.0.2743.100 (code 275610010)
I/art ( 4485): Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
I/art ( 4485): Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
I/cr_LibraryLoader( 4485): Time to load native libraries: 2 ms (timestamps 7784-7786)
I/cr_LibraryLoader( 4485): Expected native library version number "52.0.2743.100", actual native library version number "52.0.2743.100"
I/art ( 4485): Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebMessagePortAdapter>
V/WebViewChromiumFactoryProvider( 4485): Binding Chromium to main looper Looper (main, tid 1) {2c31c134}
I/cr_LibraryLoader( 4485): Expected native library version number "52.0.2743.100", actual native library version number "52.0.2743.100"
I/chromium( 4485): [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_BrowserStartup( 4485): Initializing chromium process, singleProcess=true
E/EGL_adreno( 4485): CreateContext rcMajorVersion:3, minorVersion:0
D/EGL_adreno( 4485): eglCreateContext: 0x95cace80: maj 3 min 0 rcv 3
W/cr_media( 4485): Requires BLUETOOTH permission
I/cr_DRP ( 4485): No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
I/art ( 4485): Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
I/art ( 4485): Rejecting re-init on previously-failed class java.lang.Class<org.chromium.content.browser.FloatingWebActionModeCallback>
W/cr_AwContents( 4485): onDetachedFromWindow called when already detached. Ignoring
V/FolioWebView( 4485): -> init
V/FolioWebView( 4485): -> initViewTextSelection
V/ResourceHandler( 4485): Method: GET, Uri: /book2/OEBPS/cover.xml
I/System.out( 4485): Failed to create TextToSpeech
W/cr_AwContents( 4485): onDetachedFromWindow called when already detached. Ignoring
V/FolioWebView( 4485): -> init
V/FolioWebView( 4485): -> initViewTextSelection
V/ResourceHandler( 4485): Method: GET, Uri: /book2/OEBPS/GeographyofBli_copyright.html
I/System.out( 4485): Font family: Roboto
I/cr_Ime ( 4485): ImeThread is not enabled.
I/System.out( 4485): Font family: Roboto
I/cr_Ime ( 4485): ImeThread is not enabled.
E/libEGL ( 4485): validate_display:255 error 3008 (EGL_BAD_DISPLAY)
W/AudioCapabilities( 4485): Unsupported mime audio/x-ms-wma
W/AudioCapabilities( 4485): Unsupported mime audio/vnd.rn-realaudio
W/AudioCapabilities( 4485): Unsupported mime audio/mpeg-L2
W/AudioCapabilities( 4485): Unsupported mime audio/ac3
W/AudioCapabilities( 4485): Unsupported mime audio/x-ape
W/AudioCapabilities( 4485): Unsupported mime audio/vnd.dts
W/AudioCapabilities( 4485): Unsupported mime audio/ffmpeg
W/VideoCapabilities( 4485): Unsupported mime video/mpeg2
W/VideoCapabilities( 4485): Unsupported mime video/x-ms-wmv
W/VideoCapabilities( 4485): Unsupported mime video/vnd.rn-realvideo
W/VideoCapabilities( 4485): Unsupported mime video/vc1
W/VideoCapabilities( 4485): Unsupported mime video/x-flv
W/VideoCapabilities( 4485): Unsupported mime video/divx
W/VideoCapabilities( 4485): Unsupported mime video/ffmpeg
I/VideoCapabilities( 4485): Unsupported profile 4 for video/mp4v-es
E/cr_MediaCodecUtil( 4485): Decoder for type video/x-vnd.on2.vp9 is not supported on this device
D/ ( 4485): HostConnection::get() New Host Connection established 0x944dc880, tid 4573
E/EGL_adreno( 4485): CreateContext rcMajorVersion:3, minorVersion:0
D/EGL_adreno( 4485): eglCreateContext: 0xaed1a160: maj 3 min 0 rcv 3
W/cr_BindingManager( 4485): Cannot call determinedVisibility() - never saw a connection for the pid: 4485
V/CSSHandler( 4485): Method: GET, Uri: /styles/ltr-before.css
V/ResourceHandler( 4485): Method: GET, Uri: /book2/stylesheet.css
W/cr_BindingManager( 4485): Cannot call determinedVisibility() - never saw a connection for the pid: 4485
V/CSSHandler( 4485): Method: GET, Uri: /styles/ltr-default.css
V/ResourceHandler( 4485): Method: GET, Uri: /book2/page_styles.css
V/JSHandler( 4485): Method: GET, Uri: /scripts/touchHandling.js
V/CSSHandler( 4485): Method: GET, Uri: /styles/ltr-after.css
V/JSHandler( 4485): Method: GET, Uri: /scripts/utils.js
V/ResourceHandler( 4485): Method: GET, Uri: /book2/OEBPS/images/GeographyofBli-cover.jpg
V/FolioPageFragment( 4485): -> onPageFinished -> took from getEntryReadLocator
V/FolioActivity( 4485): -> onPageSelected -> DirectionalViewpager -> position = 1
W/TextToSpeech( 4485): isSpeaking failed: not bound to TTS engine
V/FolioActivity( 4485): -> onPageScrollStateChanged -> DirectionalViewpager -> position = 1
V/FolioPageFragment( 4485): -> scrollToLast -> isPageLoading = false
D/FolioWebView( 4485): -> dismissPopupWindow -> /OEBPS/cover.xml
V/FolioPageFragment( 4485): -> scrollToFirst -> isPageLoading = true
I/System.out( 4485): Failed to create TextToSpeech
W/cr_AwContents( 4485): onDetachedFromWindow called when already detached. Ignoring
V/FolioWebView( 4485): -> init
V/FolioWebView( 4485): -> initViewTextSelection
V/ResourceHandler( 4485): Method: GET, Uri: /book2/OEBPS/GeographyofBli_toc.html
V/WebViewConsole( 4485): -> scrollToLast [file:///android_asset/js/Bridge.js:493]
I/System.out( 4485): Font family: Roboto
I/cr_Ime ( 4485): ImeThread is not enabled.
W/cr_BindingManager( 4485): Cannot call determinedVisibility() - never saw a connection for the pid: 4485
V/CSSHandler( 4485): Method: GET, Uri: /styles/ltr-before.css
V/ResourceHandler( 4485): Method: GET, Uri: /book2/stylesheet.css
V/CSSHandler( 4485): Method: GET, Uri: /styles/ltr-default.css
V/ResourceHandler( 4485): Method: GET, Uri: /book2/page_styles.css
V/CSSHandler( 4485): Method: GET, Uri: /styles/ltr-after.css
V/JSHandler( 4485): Method: GET, Uri: /scripts/touchHandling.js
V/JSHandler( 4485): Method: GET, Uri: /scripts/utils.js
and here when i press the features iconbutton:
Restarted application in ۲٬۷۲۳ms.
V/FolioActivity( 4485): -> onOptionsItemSelected -> Configuration
W/art ( 4485): Before Android 4.1, method int androidx.appcompat.widget.DropDownListView.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
I/ListPopupWindow( 4485): Could not find method setEpicenterBounds(Rect) on PopupWindow. Oh well.
D/FolioWebView( 4485): -> dismissPopupWindow -> /OEBPS/cover.xml
V/FolioWebView( 4485): -> initViewTextSelection
V/FolioPageFragment( 4485): -> getLastReadLocator -> /OEBPS/GeographyofBli_copyright.html
D/FolioWebView( 4485): -> dismissPopupWindow -> /OEBPS/GeographyofBli_copyright.html
V/FolioWebView( 4485): -> initViewTextSelection
D/FolioWebView( 4485): -> dismissPopupWindow -> /OEBPS/GeographyofBli_toc.html
V/FolioWebView( 4485): -> initViewTextSelection
I/Choreographer( 4485): Skipped 302 frames! The application may be doing too much work on its main thread.
I/System.out( 4485): Font family: AndroidClock
I/System.out( 4485): Injected user font into CSS
I/System.out( 4485): - path: /system/fonts/AndroidClock.ttf
I/System.out( 4485): - family: 'AndroidClock'
E/WebViewConsole( 4485): Uncaught ReferenceError: DOMRect is not defined [file:///android_asset/js/Bridge.js:842]
I/System.out( 4485): Font family: AndroidClock
I/System.out( 4485): Injected user font into CSS
I/System.out( 4485): - path: /system/fonts/AndroidClock.ttf
I/System.out( 4485): - family: 'AndroidClock'
I/System.out( 4485): Font family: AndroidClock
I/System.out( 4485): Injected user font into CSS
I/System.out( 4485): - path: /system/fonts/AndroidClock.ttf
I/System.out( 4485): - family: 'AndroidClock'
W/cr_BindingManager( 4485): Cannot call determinedVisibility() - never saw a connection for the pid: 4485
V/ResourceHandler( 4485): Method: GET, Uri: /book2/stylesheet.css
V/CSSHandler( 4485): Method: GET, Uri: /styles/ltr-default.css
V/ResourceHandler( 4485): Method: GET, Uri: /book2/page_styles.css
V/CSSHandler( 4485): Method: GET, Uri: /styles/ltr-before.css
V/CSSHandler( 4485): Method: GET, Uri: /styles/ltr-after.css
W/cr_BindingManager( 4485): Cannot call determinedVisibility() - never saw a connection for the pid: 4485
V/JSHandler( 4485): Method: GET, Uri: /scripts/touchHandling.js
V/JSHandler( 4485): Method: GET, Uri: /scripts/utils.js
V/ResourceHandler( 4485): Method: GET, Uri: /book2/OEBPS/images/GeographyofBli-cover.jpg
D/AndroidRuntime( 4485): Shutting down VM
E/AndroidRuntime( 4485): FATAL EXCEPTION: main
E/AndroidRuntime( 4485): Process: com.example.text_epub_viewer, PID: 4485
E/AndroidRuntime( 4485): kotlin.KotlinNullPointerException
E/AndroidRuntime( 4485): at com.folioreader.ui.fragment.FolioPageFragment$webViewClient$1.onPageFinished(FolioPageFragment.kt:446)
E/AndroidRuntime( 4485): at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:531)
E/AndroidRuntime( 4485): at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:188)
E/AndroidRuntime( 4485): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 4485): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 4485): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime( 4485): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4485): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 4485): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime( 4485): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I/Process ( 4485): Sending signal. PID: 4485 SIG: 9
Lost connection to device.
Exited (sigterm)