I've been using the python-for-android libs successfully in the past in order to bundle Python with my own Java application. However, Google now requires API 29 support for all updates to the Play store, and I've been unsuccessful in getting this to work.
First, according to https://python-for-android.readthedocs.io/en/latest/quickstart/#installation , the recommended NDK version is r19b, but that one no longer seems available, so I installed r19c.
I have the following environment:
export ANDROIDSDK="$HOME/android/" # The directory where tools is located, not the SDK dir
export ANDROIDNDK="$HOME/android/ndk/19.2.5345600"
export ANDROIDAPI="29" # Target API version of your application
export NDKAPI="21" # Minimum supported API version of your application
This command
p4a create --arch=armeabi-v7a,arm64-v8a,x86,x86_64 --blacklist-requirements=android,libffi,openssl
gives the following error:
...
[INFO]: Building genericndkbuild for arm64-v8a
[INFO]: -> directory context /home/pbienst/.local/share/python-for-android/build/bootstrap_builds/service_only/jni
[INFO]: -> running ndk-build V=1
working: /home/pbienst/android/ndk/19.2.5345600/build/core/setup-app-platform.mk:101: *** Android NDK: Aborting. . Stop. Exception in thread background thread for pid 98736:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.8/dist-packages/sh.py", line 1633, in wrap
fn(*rgs, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/sh.py", line 2557, in background_thread
handle_exit_code(exit_code)
File "/usr/local/lib/python3.8/dist-packages/sh.py", line 2261, in fn
return self.command.handle_command_exit_code(exit_code)
File "/usr/local/lib/python3.8/dist-packages/sh.py", line 861, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_2:
RAN: /home/pbienst/android/ndk/19.2.5345600/ndk-build V=1
STDOUT:
Android NDK: Found platform level in /home/pbienst/.local/share/python-for-android/build/bootstrap_builds/service_only/project.properties. Setting APP_PLATFORM to android-29.
Android NDK: android-29 is above the maximum supported version android-28. Choose a supported API level or set APP_PLATFORM to "latest".
/home/pbienst/android/ndk/19.2.5345600/build/core/setup-app-platform.mk:101: *** Android NDK: Aborting. . Stop.
What is the recommended way to proceed, so that I can update my Android app again?