Pool-Of-Tears / Myne

An android app to download & read ebooks from Project Gutenberg, built with Jetpack Compose.
https://pooloftears.in
Apache License 2.0
1.15k stars 66 forks source link

[Bug]: My epub file won't open #196

Closed PaulichP closed 3 months ago

PaulichP commented 3 months ago

Steps to reproduce

  1. Selecting a file in the file manager
  2. Open it with Myne
  3. An error message appears Screenshot_20240807-215622_Myne

Expected behaviour

Successful file opening and further reading.

Actual behaviour

Error

Current date: 2024-08-07 21:53:22 
Device: OnePlus PGP110 
OS version: Android 13 (SDK 33) 

Stack trace:  
P3.m: .opf file metadata section missing
    at P3.k.u(Unknown Source:1455)
    at P3.k.o(Unknown Source:12)
    at Y0.a.V(Unknown Source:4)
    at j6.z.z(Unknown Source:73)
    at i4.g.u(Unknown Source:69)
    at C4.a.B(Unknown Source:8)
    at j6.F.run(Unknown Source:112)
    at Y2.c.run(Unknown Source:36)
    at q6.i.run(Unknown Source:2)
    at q6.a.run(Unknown Source:91)
    Suppressed: o6.g: [C{Cancelling}@1d1ead9, Dispatchers.IO]

Device name

OnePlus 10t 5G (OnePlus PGP110)

Android version

Android 13

Myne version

3.9.1

Device logs

Build version: 3.9.1 
Current date: 2024-08-07 21:58:14 
Device: OnePlus PGP110 
OS version: Android 13 (SDK 33) 

Stack trace:  
P3.m: .opf file metadata section missing
    at P3.k.u(Unknown Source:1455)
    at P3.k.o(Unknown Source:12)
    at Y0.a.V(Unknown Source:4)
    at j6.z.z(Unknown Source:73)
    at i4.g.u(Unknown Source:69)
    at C4.a.B(Unknown Source:8)
    at j6.F.run(Unknown Source:112)
    at Y2.c.run(Unknown Source:36)
    at q6.i.run(Unknown Source:2)
    at q6.a.run(Unknown Source:91)
    Suppressed: o6.g: [C{Cancelling}@1d1ead9, Dispatchers.IO]

Additional information

Here's the link to the file with which the problem occurs.

starry-shivam commented 3 months ago

Thanks for reporting. It seems either the metadata of that EPUB file is invalid, or there is some problem when parsing it. Either way, it should not cause a crash (it doesn't for me) and should show an error message above the bottom navigation bar instead. I'm not sure why it caused a crash in your case. I'll investigate further to figure out both issues.

starry-shivam commented 3 months ago

I've identified the problem. It was due to the EPUB file not using the exact tag names in manifest (.opf file) as described in the EPUB standard and adding an OPF prefix on them. I'll add handling for this edge case ASAP. Thanks again!