kaushikgodhani / vocsy_epub_viewer

Apache License 2.0
29 stars 68 forks source link

java.lang.NullPointerException: Attempt to invoke virtual method #38

Open Habnarm1 opened 1 year ago

Habnarm1 commented 1 year ago

E/NanoHTTPD( 4997): Communication with the client broken, or an bug in the handler code E/NanoHTTPD( 4997): java.lang.NullPointerException: Attempt to invoke virtual method 'org.nanohttpd.protocols.http.response.Response org.nanohttpd.router.RouterNanoHTTPD$UriResource.process(java.util.Map, org.nanohttpd.protocols.http.IHTTPSession)' on a null object reference E/NanoHTTPD( 4997): at org.nanohttpd.router.RouterNanoHTTPD$UriRouter.process(RouterNanoHTTPD.java:597) E/NanoHTTPD( 4997): at org.nanohttpd.router.RouterNanoHTTPD.serve(RouterNanoHTTPD.java:672) E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.NanoHTTPD$1.handle(NanoHTTPD.java:376) E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.NanoHTTPD$1.handle(NanoHTTPD.java:372) E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.NanoHTTPD.handle(NanoHTTPD.java:535) E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.HTTPSession.execute(HTTPSession.java:421) E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.ClientHandler.run(ClientHandler.java:75) E/NanoHTTPD( 4997): at java.lang.Thread.run(Thread.java:818) I/System.out( 4997): close [socket][/127.0.0.1:8080]

Anslem27 commented 1 year ago

Have you set a config like this VocsyEpub.setConfig( themeColor: Theme.of(context).primaryColor, identifier: "iosBook", scrollDirection: EpubScrollDirection.ALLDIRECTIONS, allowSharing: true, enableTts: true, nightMode: true, ); as indicated in the readme. Before opening the epub file?

Habnarm1 commented 1 year ago

Hello, can you add page count as well as ability to to do text to speech, also as for this error its fixed thanks

Habnarm1 commented 1 year ago

also how can i read directly from URL and not via asset

Anslem27 commented 1 year ago

Hello, can you add page count as well as ability to to do text to speech, also as for this error its fixed thanks

Okay that's great

Anslem27 commented 1 year ago

also how can i read directly from URL and not via asset

As per now that isn't supported, however there is a way, you can go away with it.

Create a function to download and save the epub, then store the path somewhere you can easily access, then always just reference that path, whenever you wish to open the epub.

Or maybe if you have sometime on your hand, you could make a custom epub viewer easily by forking and try to manoeuvre this repository around as it has the basic functions to extract what you need from the epub, and all in dart code.

https://github.com/ScerIO/epubx.dart

Hope this helps

Habnarm1 commented 1 year ago

Thanks