readium / readium-lcp-client

This repository is for the Readium Licenced Content Protection (LCP) client side implementation work.
BSD 3-Clause "New" or "Revised" License
16 stars 12 forks source link

Android : Need help in integrating lcp-client into readium library. #50

Open nareshsvn opened 5 years ago

nareshsvn commented 5 years ago

Hi,

Android issue: I am new to lcp . When I integrated lcp-client into readium library i am facing following issue.

issue description: Plugin with id 'com.android.model.library' not found. (build.gradle which is there in lcp-client module).

Steps I followed for the lcp integration into readium-1:

  1. I cloned the code using "git clone --recursive https://github.com/readium/SDKLauncher-Android.git"

  2. I opened this code from android studio and from android studio I shifted to "feature/lcp" branch from "master" branch.

  3. Here I found a readium-lcp-client folder which is empty.

  4. I downloaded readium-lcp-client code from github and I put that code into readium-lcp-client folder(step 3).

  5. I tapped on sync button. Then I can see the above mentioned error.

Could please help me what went wrong in integration ?

Many Thanks, Naresh

danielweck commented 5 years ago

After step (1) you forgot to initialize the Git submodules: cd SDKLauncher-Android && git submodule update --init --recursive

danielweck commented 5 years ago

Then, use the branch feature/latest-working-build-config for your cloned SDKLauncher-Android Git repository, and follow the advice in this Pull Request: https://github.com/readium/SDKLauncher-Android/pull/147

Same for readium-sdk (pay attention to the Java versions): https://github.com/readium/readium-sdk/pull/317

Same for readium-lcp-client: https://github.com/readium/readium-lcp-client/pull/49

I hope this helps you. It did help me :) (I created the PRs)

nareshsvn commented 5 years ago

Thanks for your very quick support,

I tried to build the project as per your suggestion in this process I encountered another issue.

I listed steps I followed and please let me know where I went wrong in integration?

Steps followed to build the project:

  1. I cloned the code using "git clone --recursive https://github.com/readium/SDKLauncher-Android.git"

  2. cd SDKLauncher-Android && git submodule update --init --recursive

  3. I opened this code from android studio and from android studio I shifted to "I opened this code from android studio and from android studio I shifted to "feature/latest-working-build-config" branch from "master" branch." branch from "master" branch.

  4. Added local.properties files for SDK-Launcher , readium-sdk, redium-lcp-client. (readium/SDKLauncher-Android#147, readium/readium-sdk#317, #49). I am using java"1.8.0_191".

  5. I downloaded readium-lcp-client code from github and I put that code into readium-lcp-client folder, I run following commands under SDKLauncher-Android\readium-lcp-client-master\platform\android

a) $ ./gradlew clean

output:

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 5.239 secs

b) $ ./gradlew build - successful

  1. From android studio tapped on sync and it was successful, I installed build on device. And I selected a folder to open .lcpl file in app, immediately app got crashed by giving following error message.

output:

couldn't find "liblcp.so"

Crash log:

2018-11-29 11:21:29.662 11377-11377/org.readium.sdk.android.launcher E/AndroidRuntime: FATAL EXCEPTION: main Process: org.readium.sdk.android.launcher, PID: 11377 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.readium.sdk.android.launcher-2/base.apk"],nativeLibraryDirectories=[/data/app/org.readium.sdk.android.launcher-2/lib/arm, /data/app/org.readium.sdk.android.launcher-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "liblcp.so" at java.lang.Runtime.loadLibrary0(Runtime.java:972) at java.lang.System.loadLibrary(System.java:1567) at org.readium.sdk.lcp.ServiceFactory.(ServiceFactory.java:39) at org.readium.sdk.lcp.ServiceFactory.build(ServiceFactory.java:58) at org.readium.sdk.android.launcher.ContainerList.onCreate(ContainerList.java:280) at android.app.Activity.performCreate(Activity.java:6948) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2924) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3042) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1639) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6780) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1500) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1390) 2018-11-29 11:21:29.834 1510-11884/? E/BatteryStatsService: no controller energy info supplied