Open washeeeq opened 5 years ago
It seems it always fail on creating outputstream here:
public static Boolean saveTempEpubFile(String filePath, String fileName, InputStream inputStream) {
OutputStream outputStream = null;
File file = new File(filePath);
try {
if (!file.exists()) {
File folder = new File(getFolioEpubFolderPath(fileName));
folder.mkdirs();
**outputStream = new FileOutputStream(file);**
Tried to add to the manifest those lines:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
Did you manage to resolve this issue? I am facing the same problem.
Using Android 10 and targetSdkVersion 29
Environment.getExternalStorageDirectory()
deprecated may be this issue to find your book link
AndroidManifest.xml file add this line work fine in android 10 and targetSdkVersion 29
<application
.................
android:requestLegacyExternalStorage="true">
If you have a similar problem on Android 11 then you can solve that checkout this comment
Hi all :-) I really like the preview you have provided on Github, eager to start using it!
I was unfortunately unable to run it on the emulator:
`val folioReader = FolioReader.get()
E/FileUtil: /storage/emulated/0/folioreader/sensei_1_book_en/sensei_1_book_en.epub: open failed: ENOENT (No such file or directory) E/Error: Could not generate container java.lang.Exception: Missing File at org.readium.r2.streamer.parser.EpubParser.generateContainerFrom(EpubParser.kt:52) 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:7783) at android.app.Activity.performCreate(Activity.java:7772) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3235) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3396) 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:2009) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7319) 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:934) D/AppUtil: -> getAvailablePortNumber -> portNumber 8080 available E/FolioActivity: -> Failed to initialize book kotlin.KotlinNullPointerException at com.folioreader.ui.activity.FolioActivity.initBook(FolioActivity.kt:493) 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:7783) at android.app.Activity.performCreate(Activity.java:7772) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3235) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3396) 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:2009) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7319) 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:934)