p4a Could not find `android` or `sdkmanager` binaries in Android SDK. Exiting

1,062 views
Skip to first unread message

David Zarebski

unread,
Mar 26, 2018, 12:00:08 PM3/26/18
to Kivy users support
I spend hours struggling on this issue and I feel dumb as f***. I followed this doc, installed everything I needed until the effective building step:

p4a apk --debug --private $HOME/Documents/Code/Python/app_kivy/identifier/main.py --package=org.example.myapp --name "My application" --version 0.1 --bootstrap=sdl2 --requirements=python2,kivy
[INFO]:    Will compile for the following archs: armeabi
[INFO]:    Found Android API target in $ANDROIDAPI
[ERROR]:   Could not find `android` or `sdkmanager` binaries in Android SDK. Exiting.

Here is the end of my .bashrc
# Adjust the paths!
export ANDROIDSDK="$HOME/Android/Sdk/"
export ANDROIDNDK="$HOME/Apps/android-ndk-r16b/"
export ANDROIDAPI="19"  # Minimum API version your application require
export ANDROIDNDKVER="r16b"  # Version of the NDK you installed

I tried several paths variants, tried both the full Android Studio and the ‘just the command line tools’ methods of the doc, nothing. NB android and sdkmanager are installed in different folders (resp. tools and tools/bin). I am pretty sure that I am missing something in the .bashrc but what am I missing?

Thanks in advance for any insight



Ymerej

unread,
Mar 7, 2019, 11:06:08 AM3/7/19
to Kivy users support
Hi,

I followed the same tutorial and got the same error. In my case, I use this command and it works :
p4a apk --private $HOME/code/myapp --package=org.example.myapp --name "My application" --version 0.1 --bootstrap=sdl2 --requirements=python2,kivy --sdk-dir $HOME/android --ndk-dir $HOME/android/android-ndk-r19b

The first problem I faced is that the path for SDK was not right, I used $HOME/android/tools instead of $HOME/android.
The second problem was that my environments variables $ANDROIDSDK and $ANDROIDNDK were not recognized by p4a. Using the --sdk-dir and --ndk-dir was successfull.

Hope this can help somebody in the future.

Robert Flatt

unread,
Mar 7, 2019, 4:30:06 PM3/7/19
to Kivy users support
I wrote these instructions a while ago, perhaps it will help....
Reply all
Reply to author
Forward
0 new messages