netty / netty-incubator-codec-quic

Apache License 2.0
301 stars 70 forks source link

How to build it for android? #403

Closed jekinleeph closed 1 year ago

jekinleeph commented 2 years ago

I use "mvnw package -P android" to package the project, but it failed. Are there any build documents about this project?

lxl53535 commented 1 year ago

the option "android" is netty_quiche the opetion "android-arm64-v8a"、 "android-armeabi-v7a" ... is optional image add "ANDROID_NDK_HOME"、"ANDROID_HOME", it can be optimized by volumes install cargo-ndk

image image add "build-android" option

image

edit pom , remove these rows

cd ${project.basedir}
run docker-compose -f docker/docker-compose.centos-7.yaml -f docker/docker-compose.centos-7.18.yaml run build-android

wait ....

test ... image image

Snowmaze-dev commented 1 year ago

Hi, I’m wondering if anyone can build aars for all abis (or at least for armeabi-v7a) for me. I tried to build it on windows but I encountered a lot of errors that I don’t know how to fix. Make for some reason can't build boringssl. I would really appreciate your help.

JBou commented 1 year ago

EDIT:

For anyone interested, there is a sample project at https://github.com/JBou/netty-quic-demo that is working as of 19.07.2023 using netty-incubator-codec-quic:0.0.38.Final. It also contains the compiled android library. It may be updated in the future for newer versions.


I just fixed building for Android in #553, it was not working since #493.

Please take a look in the ci-build.yml GitHub workflow for the steps you have to make and the dependencies you need to install. Once you have installed all the dependencies, start the build with mvnw clean package -Dandroid. This builds the aar library for Android that contains native libraries for all 4 Android ABIs

In the meantime, you can download the built Android library from my fork from the artifacts tab, where I built it today using the workflow above using the newest version available: https://github.com/JBou/netty-incubator-codec-quic/actions/runs/5505784359

I was not able to build it on Windows, I used WSL for development and building it. I can confirm it worked after the dependencies and prerequisites were all installed correctly.

I try to update #322 in the next time and if it is possible for @normanmaurer to include the Android artifact in the maven repo, a lot of people would not need to build it themselves, and it would make it less difficult to use.

normanmaurer commented 1 year ago

Let me close this one... Not sure about also releasing for android yet.