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

Android build fails with NDK r23 #4276

Closed
enwi opened this issue Oct 13, 2021 · 8 comments · Fixed by #4380
Closed

Android build fails with NDK r23 #4276

enwi opened this issue Oct 13, 2021 · 8 comments · Fixed by #4380

Comments

@enwi
Copy link

enwi commented Oct 13, 2021

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
Copy link
Author

enwi commented Oct 13, 2021

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

@bluca
Copy link
Member

bluca commented Oct 13, 2021

Can to send a PR to fix it?

@enwi
Copy link
Author

enwi commented Oct 13, 2021

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

@benjdero
Copy link
Member

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
Copy link
Member

bluca commented Oct 15, 2021

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

@enwi
Copy link
Author

enwi commented Oct 22, 2021

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)

@rubar-tech
Copy link

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

@benjdero
Copy link
Member

benjdero commented May 9, 2022

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.

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 a pull request may close this issue.

4 participants