Running readium library and sample in android project

15 posts / 0 new
Last post

I tried to run readium sample project, imported the library and sample project successfully with no errors

but the application crashes after splashscreen..

Sample Project Name: SDKLauncher-Android
Error file name : ContainerList.java
Error line: EPub3.setCachePath(getCacheDir().getAbsolutePath());
Error details ...

10-21 16:17:48.710: E/AndroidRuntime(14201): FATAL EXCEPTION: main
10-21 16:17:48.710: E/AndroidRuntime(14201): java.lang.ExceptionInInitializerError
10-21 16:17:48.710: E/AndroidRuntime(14201): at org.readium.sdk.android.launcher.ContainerList.onCreate(ContainerList.java:81)
10-21 16:17:48.710: E/AndroidRuntime(14201): at android.app.Activity.performCreate(Activity.java:4465)
10-21 16:17:48.710: E/AndroidRuntime(14201): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
10-21 16:17:48.710: E/AndroidRuntime(14201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1932)
10-21 16:17:48.710: E/AndroidRuntime(14201): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1999)
10-21 16:17:48.710: E/AndroidRuntime(14201): at android.app.ActivityThread.access$600(ActivityThread.java:127)
10-21 16:17:48.710: E/AndroidRuntime(14201): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1159)
10-21 16:17:48.710: E/AndroidRuntime(14201): at android.os.Handler.dispatchMessage(Handler.java:99)
10-21 16:17:48.710: E/AndroidRuntime(14201): at android.os.Looper.loop(Looper.java:137)
10-21 16:17:48.710: E/AndroidRuntime(14201): at android.app.ActivityThread.main(ActivityThread.java:4513)
10-21 16:17:48.710: E/AndroidRuntime(14201): at java.lang.reflect.Method.invokeNative(Native Method)
10-21 16:17:48.710: E/AndroidRuntime(14201): at java.lang.reflect.Method.invoke(Method.java:511)
10-21 16:17:48.710: E/AndroidRuntime(14201): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:974)
10-21 16:17:48.710: E/AndroidRuntime(14201): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:741)
10-21 16:17:48.710: E/AndroidRuntime(14201): at dalvik.system.NativeStart.main(Native Method)
10-21 16:17:48.710: E/AndroidRuntime(14201): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load epub3: findLibrary returned null
10-21 16:17:48.710: E/AndroidRuntime(14201): at java.lang.Runtime.loadLibrary(Runtime.java:365)
10-21 16:17:48.710: E/AndroidRuntime(14201): at java.lang.System.loadLibrary(System.java:535)
10-21 16:17:48.710: E/AndroidRuntime(14201): at org.readium.sdk.android.EPub3.<clinit>(EPub3.java:42)
10-21 16:17:48.710: E/AndroidRuntime(14201): ... 15 more

Need a solution

>10-21 16:17:48.710: E/AndroidRuntime(14201): Caused by: java.lang.UnsatisfiedLinkError: >Couldn't load epub3: findLibrary returned null
I had the same problem and fixed.
Is your 'readium-sdk' directory empty?

Yes readium-sdk folder is empty... how can I solve this... what content should be there in readium-sdk directory.?

@shettyvn, you might not get the whole project as I did.
git clone --recursive https://github.com/readium/Launcher-Android.git
Please note that "--recursive" is necessary.

I just downloaded using git clone and imported in to eclipse..But first I got lint error in WebViewActivity openBook(pckg.toJSON(), openPageRequestData);(Error: The method openBook(String, String) in the type WebViewActivity is not applicable for the arguments (JSONObject, String)... So changed that line to openBook(pckg.toJSON(), openPageRequestData); After running app crashes....Error in ddms same as what already mentioned in question...Pls help TIA.

{EDIT to #6 comment) :I just downloaded using git clone and imported in to eclipse..But first I got lint error in WebViewActivity openBook(pckg.toJSON(), openPageRequestData);(Error: The method openBook(String, String) in the type WebViewActivity is not applicable for the arguments (JSONObject, String)... So changed that line to openBook(pckg.toJSON().toString, openPageRequestData); After running app crashes....Error in ddms same as what already mentioned in question...Pls help TIA.

You might need to cd to readium-sdk folder and build it first.
I made a symbolic link in SDKLauncher-Android to the readium-sdk which already built (libepub3.so is generated). And it works.

where can I find libepub3.so file? Im building through eclipse NDK path is already exist in android build path ..and it builds every time

Follow the instruction of README.md in SDKLauncher-Android:

How to build
-------------------------------
cd readium-sdk/Platform/Android
./ndk-compile.sh build your-ndk-path

I tried to build that using both cygwin and gitshell but getting some errors..

Admin@SOFTWARE /d/RESEARCH/GitHub/EPUB/Launcher-Android/readium-sdk/Platform/And
roid ((465140d...))
$ ./ndk-compile.sh build
Starting ndk-build...

Project path: D:/RESEARCH/GitHub/EPUB/Launcher-Android/readium-sdk/Platform/Andr
oid
NDK path: D:/ANDROID_NDK/android-ndk-r8e-windows-x86_64/android-ndk-r8e
Command: build

./MakeHeaders.sh: Platform/Android/MakeHeaders.sh: /bin/zsh^M: bad interpreter:
No such file or directory
/d/RESEARCH/GitHub/EPUB/Launcher-Android/readium-sdk/Platform/Android
ERROR: Cannot find 'make' program. Please install Cygwin make package
or define the GNUMAKE variable to point to it.

Admin@SOFTWARE /d/RESEARCH/GitHub/EPUB/Launcher-Android/readium-sdk/Platform/And
roid ((465140d...))
$
Followed steps mentioned in README Doc.. Dont know what is happening
...Thanks

Your problem seems caused by setting (& installation?) of Cygwin. Sorry that I use Ubuntu and can do little help.

@bjc its working now :) thanks a lot....

Hello shettyvn, can you provide a step by step on how you managed to build?

Thanks

@flexpeace problem was with the windows system and cygwin So I built in Mac system.

As @bjc told,

Follow the instruction of README.md in SDKLauncher-Android:

How to build
-------------------------------
cd readium-sdk/Platform/Android
./ndk-compile.sh build your-ndk-path

Secondary menu