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

Various Android / Gradle updates (current working build) #317

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

danielweck
Copy link
Member

@danielweck danielweck commented Nov 19, 2018

Upgraded API 26 to 28, build tools to 28.0.3, Gradle 5.4.1, max processors / thread 6 (native NDK compiler). NDK is version 16.1.4479499:
https://github.com/android/ndk/wiki/Unsupported-Downloads#r16b
https://developer.android.com/ndk/downloads/older_releases#ndk-16b-downloads

Notes:

platform/android/local.properties

(not checked into Git, must be created by developers)

sdk.dir=/PATH_TO/Android/sdk
ndk.dir=/PATH_TO/Android/sdk/ndk-bundle-old
readium.ndk_clang=false
readium.ndk_skipX86=false
readium.ndk_skipARM=false
readium.ndk_experimental=false

Note that AndroidStudio ships with the most recent ndk-bundle (version 18+), but ReadiumSDK requires version 16-b (which I downloaded into the sibling ndk-bundle-old folder).

gradle-wrapper.properties

When using the Gradle "experimental" plugin (as configured in local.properties, see above), Platform/Android/gradle/wrapper/gradle-wrapper.properties must be edited to change from version 5.4.1 to 3.3.

Java versions

OpenJDK 12 is now compatible with the latest Gradle (11 was broken due to missing private-API / proprietary libraries which are not available by default anymore). For the Gradle experimental plugin I still have to install JDK 1.8. On MacOS, I actually have the legacy version 1.6 as well:
ls /Library/Java/JavaVirtualMachines/
==>

1.6.0.jdk
jdk-11.0.1.jdk
jdk-12.0.1.jdk
jdk1.8.0_202.jdk

...and my shell configuration looks like:
cat ~/.bash_profile
==>

export JAVA_HOME="$(/usr/libexec/java_home -v 11)"
export PATH=/PATH_TO/Android/sdk/platform-tools:$PATH

...so I just invoke this shell command in order to switch to the compatible Java runtime:
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)" && java -version
==>

java version "1.8.0_202-ea"
Java(TM) SE Runtime Environment (build 1.8.0_202-ea-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b03, mixed mode)

Build output

When invoking gradlew assembleDebug, a successful build output libs into the Platform/Android/epub3/libs/ folder (armeabi-v7a and x86 subfolders). However, compiling the readium-lcp-client lib requires adding DEBUG and RELEASE folders in order to differentiate the build flavours. So I create these folders manually and copy the files across.

Hopefully this will help someone else :)

…to 28.0.3, Gradle 4.10.2, max processors / thread 6 (native NDK compiler)
danielweck added a commit to readium/readium-lcp-client that referenced this pull request Nov 19, 2018
…28, build tools to 28.0.3, Gradle 4.10.2, max processors / thread 6 (native NDK compiler), see readium/readium-sdk#317
danielweck added a commit to readium/SDKLauncher-Android that referenced this pull request Nov 19, 2018
@danielweck
Copy link
Member Author

…va JDK 12) and experimental (NDK DSL, Java JDK 1.8)
@danielweck
Copy link
Member Author

…e) and Gradle experimental plugin (NDK DSL). AARs now created with dual 32-64 bits libs, and with ARM+x86, or ARM alone, or x86 alone
…nt) via post-compile script for each ABI target (ARM, x86, 32 and 64 bits)
…adle setup (mixed CMake + Makefile etc. leads to inconsistent RELEASE/DEBUG output folders)
…er, using gradle.taskGraph.whenReady to pick-up DEBUG vs. RELEASE
@aviashiet
Copy link

Getting below error -
ndk-bundle/ndk-build'' finished with non-zero exit value

@danielweck
Copy link
Member Author

@aviashiet have you followed the instructions at the top of this PR? Are you using the exact same versions?

@aviashiet
Copy link

@danielweck -Yes i am using -https://github.com/readium/readium-sdk/tree/feature/latest-working-build-config

Now getting below error -
Cause: org.jetbrains.plugins.gradle.tooling.util.ModuleComponentIdentifierImpl.getModuleIdentifier()Lorg/gradle/api/artifacts/ModuleIdentifier;

@danielweck
Copy link
Member Author

What are the actual installed versions in your command line? (NDK, Java, Gradle, etc.)

@aviashiet
Copy link

@danielweck - Now i can made 64 bit .so file ,Thanks a lot Daniel

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

Successfully merging this pull request may close these issues.

None yet

2 participants