kivy / python-for-android

Turn your Python application into an Android APK
https://python-for-android.readthedocs.io
MIT License
8.35k stars 1.86k forks source link

Can't get off the ground #485

Closed benson-basis closed 9 years ago

benson-basis commented 9 years ago

I'm trying to fix the APK build of pyjinus, but I'm failing to get p-for-a to work at all, following the instructions on http://python-for-android.readthedocs.org/en/latest/quickstart/#installation. Note in particular that setting the NDK version as documented is not effective.

@dessant? Help?

➜  pyjnius git:(python3) export ANDROIDNDKVER=r14
➜  pyjnius git:(python3) python-for-android apk help
[INFO]:    This python-for-android revamp is an experimental alpha release!
[INFO]:    It should work (mostly), but you may experience missing features or bugs.
[INFO]:    Android API target was not set manually, using the default of 15
[INFO]:    Available Android APIs are ()
[WARNING]: Requested API target 15 is not available, install it with the SDK android tool.
[WARNING]: Exiting.
➜  pyjnius git:(python3) 
inclement commented 9 years ago

The error is suggesting that your SDK doesn't have any platform tools installed (you need these for a specific android version) - by default it tries to target version 15.

You can check this by running the 'android' command from the SDK, which will give a gui from which you can install some tools.

If you think you have some platform tools installed, maybe p4a is detecting it wrong and I'll reopen.

peppeska commented 9 years ago

Hi, I installed "Android SDK Platform-tools" (23.0.1) from the tool Android, but I still have the same error.

inclement commented 9 years ago

You need the 'SDK Platform' from a specific api number.

freemant2000 commented 7 years ago

Note that an Android SDK can target multiple API versions, so it is talking about a missing API version instead of an SDK version. I fixed the problem by: 1) run ~/.buildozer/android/platform/android-sdk-20/tools/android 2) check the API version installed. let's say it is "api 19". 3) edit buildozer.spec: android.api = 19

drjoms commented 5 years ago

OK I managed to change buildozer.spec file.

Problem seemed to go away, but now I get this:

# Apache ANT found at /home/dimko/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/dimko/.buildozer/android/platform/android-sdk-24.3.3
# Android NDK found at /home/dimko/.buildozer/android/platform/android-ndk-r18b
# Check application requirements
# Check garden requirements
# Compile platform
# Command failed: /usr/bin/python3.6 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/dimko/BashScripts/python/new/.buildozer/android/platform/build"

i have run ~/.buildozer/android/platform/android-sdk-20/tools/android

I made sure everything I could install from API15 is installed.(one package cant be installed. google intel api)

i changed those lines in spec file:

# (int) Android API to use                                                                                                                                                                                         
android.api = 19
# (int) Minimum API required                                                                                                                                                                                       
android.minapi = 19

# (int) Android SDK version to use                                                                                                                                                                                 
android.sdk = 24.3.3

# (str) Android NDK version to use                                                                                                                                                                                 
android.ndk = 18b

i am still getting error above. Another bug?(shouldnt it complain about api19, which i also installed?)

davied9 commented 5 years ago

I've encounter the same problem,

[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI
[INFO]:    Available Android APIs are (23, 27)
[WARNING]: Requested API target 29 is not available, install it with the SDK android tool.
[WARNING]: Exiting.
# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=SimpleApp --bootstrap=sdl2 --requirements=python3crystax,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/kivy/Desktop/Projects/TestBuildozer/build_area/android/platform/build" --ndk-api=21
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

I'm using new android sdk package, sdkmanager is suggested to be used, I run

./sdkmanager "platforms;android-27"

solve this problem, here 27 specified my required version of Android SDK