Alex Beldie
Alex Beldie

Reputation: 11

Convert .py to .apk problem with buildozer

I'm a beginner into python language. I want to develop an android app. I've wrote some code and few days ago I wanted to see how my app looks on mobile before continue. I've tried all methods to convert .py to .apk but failed. I've tried with google colab, I've installed a VM... but nothing worked. If I use google colab, after all I receive an .apk, but when I install it on my phone, doesn't work... The app opens, but closes imediatly. If I use VM I receive this error: error message

This is a picture of all my components: components

For google colab I'm using this commands : !pip install buildozer

!pip install cython==0.29.19

!sudo apt-get install -y
python3-pip
build-essential
git
python3
python3-dev
ffmpeg
libsdl2-dev
libsdl2-image-dev
libsdl2-mixer-dev
libsdl2-ttf-dev
libportmidi-dev
libswscale-dev
libavformat-dev
libavcodec-dev
zlib1g-dev

!sudo apt-get install -y
libgstreamer1.0
gstreamer1.0-plugins-base
gstreamer1.0-plugins-good

!sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libncursesw5-dev libffi-dev uuid-dev libffi6

!sudo apt-get install libffi-dev

!buildozer init

!buildozer -v android debug

!buildozer android clean

This is a picture with my google colab: google colab & buildozer.spec

I've tried all tutorials I've found on internet but nothing worked. The code works perfectly on PC!

Please, help me!

Upvotes: 0

Views: 867

Answers (2)

JSVJ
JSVJ

Reputation: 503

Can you connect phone to your system and run this command adb logcat -s python and then open the app in mobile. This will give you a log why your app crashed. I suspect some issue with the requirements in buildozer.

Could you run the command and share the log?

Upvotes: 0

Eoin Brennan
Eoin Brennan

Reputation: 151

You could try pydroid 3... This isn't really a solution but for now, if you are trying to see how your app looks on an Android device. Get Pydroid 3 from play store. Create a new file and copy your code across into the app and run it... It will run kivy but not kivymd....

If your getting the apk from colab it might be a problem in the code, trying it on pyroid my highlight something and if so when that's altered the new APK might work

Upvotes: 0

Related Questions