python-for-android icon indicating copy to clipboard operation
python-for-android copied to clipboard

When building python3.14 user should be forced to upgrade to ndk_target_24 and api_target_24 instead of throwing an error that is not understood.

Open kengoon opened this issue 3 months ago • 0 comments

I got this error while building python3.14

/home/kengo/PycharmProjects/parkkly/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/other_builds/python3/arm64-v8a__ndk_target_23/python3/Python/remote_debugging.c:48:19: error: call to undeclared function 'pwritev'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   48 |         written = pwritev(handle->memfd, local, 1, offset);
      |                   ^

After some research I discovered that:

This means the compiler encountered a call to pwritev() but couldn't find its prototype. In modern C (C99+), calling undeclared functions is no longer allowed.

And it could be fixed by patching Python/remote_debugging.c to include

#include <sys/uio.h>

Which I think should be a good option to still support lower android versions.

But then again I discovered that:

Android NDK only supports pwritev() from API level 24 (Android 7.0, Nougat) and above.

kengoon avatar Nov 12 '25 09:11 kengoon