kivy / python-for-android

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

[question]Python for android no longer supports Error ! #1978

Closed Mr-EMpiRe closed 5 years ago

Mr-EMpiRe commented 5 years ago

Hi / i have a problem after running buildozer android debug

Build failed: python-for-android no longer supports running under Python 2. Either upgrade to Python 3.4 or higher (recommended), or revert to python-for-android 2019.07.08. Note that you *can* still target Python 2 on Android by including python2 in your requirements. Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3crystax,kivy,python3 --arch armeabi-v7a --copy-libs --color=always --storage-dir="/root/Desktop/OnlyforTest/untitled123/.buildozer/android/platform/build" --ndk-api=21 ENVIRONMENT:

my p4a version is : 2019.08.09.1.dev0 how can i solve this issue ? i try to install p4a with pip and pip3 and installed with no error and clean.

but how can i change the requirements from p4a ? in last line i see this error to :

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

Tnx for your time.

Mr-EMpiRe commented 5 years ago

hi again i try to reinstall all package. but that error still show//.

any advice ?

tshirtman commented 5 years ago

Uninstall with pip, make sure it's only installed with pip3.

Mr-EMpiRe commented 5 years ago

Uninstall with pip, make sure it's only installed with pip3.

hi tnx for your answer. can u tell me how can i uninstal python for android ? when i use p4a command. its work. but i cant uninstall it.

tshirtman commented 5 years ago

pip uninstall python-for-android

repeat until it says it's not installed.

then install again, but with pip3 instead of pip. pip3 install python-for-android

if you use a virtualenv, make sure it's a python3 virtualenv.

Mr-EMpiRe commented 5 years ago

pip uninstall python-for-android

repeat until it says it's not installed.

then install again, but with pip3 instead of pip. pip3 install python-for-android

if you use a virtualenv, make sure it's a python3 virtualenv.

tnx . dude itry uninstall with pip, pip2, pip3 and all done. but after installing with pip3 with your command. and run the buildozer android debug

i see that error again. [ERROR]: Build failed: python-for-android no longer supports running under Python 2. Either upgrade to Python 3.4 or higher (recommended), or revert to python-for-android 2019.07.08. Note that you can still target Python 2 on Android by including python2 in your requirements.

tshirtman commented 5 years ago

sorry, i missed that you used buildozer, in this case, you can just uninstall python-for-android, buildozer installs its own version anyway. I guess the solution is to use python3 to install buildozer as well, (so same thing, uninstall with pip2, then install with pip3).

Mr-EMpiRe commented 5 years ago

sorry, i missed that you used buildozer, in this case, you can just uninstall python-for-android, buildozer installs its own version anyway. I guess the solution is to use python3 to install buildozer as well, (so same thing, uninstall with pip2, then install with pip3).

tnx MR. i try ,then post result here .

Mr-EMpiRe commented 5 years ago

sorry, i missed that you used buildozer, in this case, you can just uninstall python-for-android, buildozer installs its own version anyway. I guess the solution is to use python3 to install buildozer as well, (so same thing, uninstall with pip2, then install with pip3).

hi again. i try to uninstall what ever u said. and buildozer made one file with python-for-android name. anyway. , i dont have p4a installed on kali adter removing from pip3.

but after enter that command (buildozer android debug) my first error still show! and after removing buildozer . now i see Aidl cannot be executed from buildozer android debug any advice?

edit ... i go to remove kali and install everything from begin. but can u suggest me one fix and usfull version of buildozer and ndk and sdk to install ?

tnx

tshirtman commented 5 years ago

buildozer will automatically install the ndk and sdk as needed, if you get the aidl error, please use this command.

    ~/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager "build-tools;29.0.0"

as documented here https://buildozer.readthedocs.io/en/latest/installation.html#aidl-not-found-please-install-it

Mr-EMpiRe commented 5 years ago

buildozer will automatically install the ndk and sdk as needed, if you get the aidl error, please use this command.

    ~/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager "build-tools;29.0.0"

as documented here https://buildozer.readthedocs.io/en/latest/installation.html#aidl-not-found-please-install-it

Hi again. dude i removed it the 29.0.2 build tools from sdk. and installed 29.0.0 with your command.

after that i used buildozer android debug. then automatically build tools updated to 29.0.2 again ! and aidl error return.

here is full error after android debug:

Run '/root/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager "build-tools;29.0.2"'
 Cwd /root/.buildozer/android/platform/android-sdk
[=======================================] 100% Unzipping... android-10/lib64/lib
 Check that aidl can be executed
Search for Aidl
 Run '/root/.buildozer/android/platform/android-sdk/build-tools/29.0.2/aidl'
 Cwd None
 Aidl cannot be executed

(i can run aidl from sdk path fut with debug cant be run) how can i set 29.0.0 as default build tools ? i dont want 29.0.2 install automatically after running "buildozer android debug" maybe 29.0.2 not fix in my struct. any idea ?

Mr-EMpiRe commented 5 years ago

my problem isnt solve/ but i use windows instead linux and work well. good luck

Arsh1219 commented 1 year ago

pip uninstall python-for-android

repeat until it says it's not installed.

then install again, but with pip3 instead of pip. pip3 install python-for-android

if you use a virtualenv, make sure it's a python3 virtualenv.

Thanks buddy.