zeromq/libzmq

Android build fails with NDK r23

enwi opened this issue · 8 comments

enwi commented

Issue description

Using the latest Android NDK (r23) the build fails due to the removed folder platforms inside the NDK, which the build script is trying to access.

Environment

  • libzmq version (commit hash if unreleased): 5d8d857
  • OS: Linux

Minimal test code / Steps to reproduce the issue

export NDK_VERSION=android-29
export MIN_SDK_VERSION=29
./build.sh arm

What's the actual result? (include assertion message & call stack if applicable)

Android (arm) build failed for the following reasons:
  The ANDROID_BUILD_SYSROOT directory does not exist
    /Android/Sdk/ndk/23.0.7599858/platforms/android-29/arch-arm

What's the expected result?

The build should not fail, thus the build script needs to be adjusted for new releases of the Android NDK.

enwi commented

For the time being I will use the older r21e version of NDK, but still this should be addressed

bluca commented

Can to send a PR to fix it?

enwi commented

Sadly I can't I don't know what is needed to fix this atm.

I updated zeromq build scripts for Android so they work with NDK r22b, haven't tried r23 yet.

There is some breaking changes noted in the changelog of NDK r23:

Jelly Bean (APIs 16, 17, and 18) will not be supported in the next NDK release. The minimum OS supported by the NDK for r24 will be KitKat (API level 19).

@bluca @sappo What's zeromq's policy on breaking changes?

For context, API 16 is Android 4.1, which I don't think anybody support anymore. Even apps that really need extended support like for example by targeting mostly 3rd world countries go down only to API 19 (Android 4.4).

bluca commented

the ndk version can be overridden in the scripts, so it shouldn't be an issue

enwi commented

I also got another question, which is kind of related.
Would it be possible to support building for Android using cmake? (this would make it possible to include libzmq in automated build processes for apps)
Also would it be possible to support building for Android on Windows? (because Android ndk contains compilers for windows and spinning up a vm for every build involves extra work)

i'm trying to build it for android in kivy/buildozer, that uses python4android, i have the same problem, libzmq produces lots of error with ndk r23, but ndk 19c works just fine

Would it be possible to support building for Android using cmake? (this would make it possible to include libzmq in automated build processes for apps)

The bindings for Czmq, Zyre & other projects based on Zproject already build using Cmake, but the lib itself build with Make. I think it would take considerable efforts to port the build scripts from using Make to CMake for someone who isn't used to the NDK, CMake or Zeromq build scripts for Android.

@sappo Is this something that is worth to look at? As it could bring more consistency to the Android build scripts.