Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use Readium SDK on Android prior to 4.3 (API version 18) #296

Open
Atryamie opened this issue Nov 2, 2017 · 3 comments
Open

Cannot use Readium SDK on Android prior to 4.3 (API version 18) #296

Atryamie opened this issue Nov 2, 2017 · 3 comments

Comments

@Atryamie
Copy link

Atryamie commented Nov 2, 2017

Hi,

We use the SDK readium to read book, and tried to update it to the last version 0.27.0. but we get 2 issues with the NDK.

First one will be fixed in the 0.28.0 version (965fbb6) regarding the NDK version.

The second one is regarding the Shared lib : gnustl on devices prior to 4.3. Google explain here (https://developer.android.com/ndk/guides/cpp-support.html) that devices using API prior to 18 (some readers still use 4.2 -> API 17) must include manually all the shared library. In Readium we only include epub3.so, meaning that the library doesn't find the shared lib when it try to load epub.so.

This issue is a Bug

Expected Behaviour

Open book with readium

Observed behaviour

Crash with error message :

myApp E/AndroidRuntime: FATAL EXCEPTION: main
       java.lang.ExceptionInInitializerError
           at myApp.sdk.dataService.Service.OpenBookService.getOpenBookIntent(OpenBookService.java:63)
           [...]
        Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libgnustl_shared.so" needed by "libepub3.so"; caused by load_library(linker.cpp:745): library "libgnustl_shared.so" not found
           at java.lang.Runtime.loadLibrary(Runtime.java:371)
           at java.lang.System.loadLibrary(System.java:521)
           at org.readium.sdk.android.EPub3.<clinit>(EPub3.java:45)         

Steps to reproduce

  1. Use the app on device with Android 4.2
  2. Try to read a book

Product

  • Native application (Readium SDK C++)
    • Running on in-house app
    • Android 4.2

Additional information

Test to fix it with success and no side-effect detected so far :
Add before this line : https://github.com/readium/readium-sdk/blob/develop/Platform/Android/lib/src/main/java/org/readium/sdk/android/EPub3.java#L44
this :
System.loadLibrary("gnustl_shared");

@danielweck
Copy link
Member

Thanks for sharing this!
The ReadiumSDK (in the broad sense, including readium-shared-js) does not officially support Android < 4.4 (KitKat with modern browser engine), but I guess the risk of regression bugs because of the suggested addition of System.loadLibrary("gnustl_shared"); is pretty low?

@Atryamie
Copy link
Author

Atryamie commented Nov 6, 2017

@danielweck Yes because it only replace the autoload available in newer version that allow system to autoload both static and dynamics librairies.

Loading manually this lib should not include any bugs, Android should prevent multi-load automatically.

Kind,

@danielweck
Copy link
Member

Thank you for the clarifications!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants