FolioReader / FolioReader-Android

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

Crash on Android 10 when trying to open a book #464

Open dr-Fade opened 4 years ago

dr-Fade commented 4 years ago

Issue / Feature - Issue FolioReader version - 0.5.4 FolioReader Stock / Modified - Stock Android SDK - 29 Mobile / Tablet / Emulator Info - emulator + tablet Crash / Error - Crash

Steps to reproduce / Describe in detail -

  1. Install the reader app.
  2. Pass a file to it,
  3. App crashed with an error:
    2020-07-14 14:56:33.207 7353-7353/test.app E/Error: Could not generate container
    java.io.FileNotFoundException: /storage/emulated/0/Download/book.epub (Permission denied)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:265)
        at java.util.zip.ZipFile.<init>(ZipFile.java:187)
        at java.util.zip.ZipFile.<init>(ZipFile.java:158)
        at org.readium.r2.streamer.container.ContainerEpub.<init>(ContainerEpub.kt:56)
        at org.readium.r2.streamer.parser.EpubParser.generateContainerFrom(EpubParser.kt:55)
        at org.readium.r2.streamer.parser.EpubParser.parse(EpubParser.kt:71)
        at com.folioreader.ui.activity.FolioActivity.initBook(FolioActivity.kt:477)
        at com.folioreader.ui.activity.FolioActivity.setupBook(FolioActivity.kt:447)
        at com.folioreader.ui.activity.FolioActivity.onCreate(FolioActivity.kt:296)
        at android.app.Activity.performCreate(Activity.java:7802)
        at android.app.Activity.performCreate(Activity.java:7791)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

    Adding and granting it using the adb shell pm grant ... command does not solve the problem. Maybe the permission should be added to the Folio's manifest.

adityajoshi12 commented 3 years ago

Make sure you have given storage read permission to your app.

yashdevelops commented 3 years ago

Did you get a fix to it ? I'm getting the same problem opening up EPUB files ! It opens PDF perfectly.

Magby1 commented 3 years ago

Yeah, I'm getting the same problem when trying to open from Assets.

Magby1 commented 3 years ago

Make sure you have given storage read permission to your app.

Yes i did

Nikki-Gunani commented 3 years ago

Did yo guys find any solution ?

Magby1 commented 3 years ago

No, I eventually Stopped using FolioReader.

On Mon, May 24, 2021, 12:18 AM Nikki @.***> wrote:

Did yo guys find any solution ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/FolioReader/FolioReader-Android/issues/464#issuecomment-846745281, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHXI465KLWFQZAFKHYTIXTTPHOSBANCNFSM4OZOMYAQ .

Nikki-Gunani commented 3 years ago

Are you using any other ePub reader ? Something better than this and is updated ?

Magby1 commented 3 years ago

No, I had to use Bartesc pdf reader library, If you find an updated one. Please let me know too!

On Mon, May 24, 2021, 10:47 PM Nikki @.***> wrote:

Are you using any other ePub reader ? Something better than this and is updated ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/FolioReader/FolioReader-Android/issues/464#issuecomment-847507303, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHXI4Y3VXMB6V62WWZ2WPLTPMMUZANCNFSM4OZOMYAQ .

awaisabbasaa11 commented 3 years ago

I had the same problem, finally I have solved this issue for more information check this comment