Android API 29 support

202 views
Skip to first unread message

Peter

unread,
Nov 27, 2020, 2:33:44 AM11/27/20
to Kivy users support

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?

planckp...@gmail.com

unread,
Nov 27, 2020, 3:06:12 PM11/27/20
to Kivy users support
I was a die hard p4a user but I moved to Buildozer, it is a lot more robust than it was a year ago.
It downloads NDK and SDK, generally best to use the defaults (android.api = 27, NDK=19c)

But I can build     android.api = 30  ,  and android.api=29  (NDK defaults to 19c).

Probably not the answer you wanted, except that this means what you want to do is possible.




Alexander Taylor

unread,
Nov 28, 2020, 10:48:46 AM11/28/20
to Kivy users support
The instructions are out of date, you should be able to use any recent NDK.
Reply all
Reply to author
Forward
0 new messages