Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still kivy_garden.mapview module issues with buildozer in 2022 ? #53

Closed
Iji69 opened this issue Jan 20, 2022 · 6 comments
Closed

Still kivy_garden.mapview module issues with buildozer in 2022 ? #53

Iji69 opened this issue Jan 20, 2022 · 6 comments

Comments

@Iji69
Copy link

Iji69 commented Jan 20, 2022

Hello all,

I'm writing this post because I get a problem while launching my app on android (It crashes while trying to open it on android) My app uses kivy and kivymd as a GUI. It also uses kivy_garden.mapview to display a map. It works perfectly fine on my PC. I compile it via google collab virtual environment using the "checklist" described here :

https://towardsdatascience.com/3-ways-to-convert-python-app-into-apk-77f4c9cd55af

Concerning the buildozer.spec file I know that kivy_garden.mapview is no longer specified with these following lines :

#Garden requirements

garden_requirements = mapview

So I let it like this :

#Garden requirements

#garden_requirements =

Instead, as explained on diverse GitHub threads or StackOverflow threads, I specified the kivy_garden.mapview module this way :

requirements = python3,kivy==2.0.0,kivymd==0.104.2,numpy,pillow,kivy_garden.mapview,openssl,requests

The compilation works fine and create the .apk without any problem. But when I launch the app on Android, it crashes. I read in the
MapView documentation the following advises :

" Requirements : It requires the concurrent.futures and requests. If you use it on Android / iOS, don't forget to add openssl as a requirements, otherwise you'll have an issue when importing urllib3 from requests. "

That's why there is "openssl" and "requests" in my requirements above in the .spec file. I also tried adding "urllib3" and even "futures" to the requirements.

My script (main.py) starts with these libraries imports :

import kivy
kivy.require('2.0.0')
import kivymd
from kivymd.uix.screen import MDScreen
from kivymd.app import MDApp
from kivy.uix.image import Image
from kivymd.uix.button import MDFillRoundFlatButton
from kivymd.uix.textfield import MDTextField
from kivymd.uix.label import MDLabel
from kivy_garden.mapview import MapView, MapSource, MapMarker
import numpy as np

I tried everything from buildozer/mapview issues threads like these ones :

kivy/buildozer#1186

#43

kivy/buildozer#1150

But it didn't helped... Can someone tell me how to make working kivy garden mapview on android in 2022 ?

NB: I created a version of my app without the "map functionnality", so everything as above except the kivy_garden.mapview module and it compiled and worked perfectly fine

@HyTurtle
Copy link

requests' requires need to be included: https://github.com/psf/requests/blob/main/setup.py#L43

A logcat would've stated as such.

@Iji69
Copy link
Author

Iji69 commented Jan 20, 2022

Thank you for your answer !

But you mean in the spec file at the ligne "requirements" ?
or else where ? (in my script .py for ex ?)

Because I already put request in my spec file as written above.

(Sorry i'm beginning at kivy and buildozer :) )

@HyTurtle
Copy link

At that line, but you'd need: requirements = python3,kivy==2.0.0,kivymd==0.104.2,numpy,pillow,kivy_garden.mapview,openssl,requests,charset_normalizer,chardet,idna, urllib3,certifi
(certifi should be included already by default but no harm having it here just in case)

@Iji69
Copy link
Author

Iji69 commented Jan 20, 2022

Oh I'll try that, in fact these other requirements where unknown to me.

I will tell you if it worked :)

@Iji69 Iji69 closed this as completed Jan 20, 2022
@zaheerkzz
Copy link

At that line, but you'd need: requirements = python3,kivy==2.0.0,kivymd==0.104.2,numpy,pillow,kivy_garden.mapview,openssl,requests,charset_normalizer,chardet,idna, urllib3,certifi (certifi should be included already by default but no harm having it here just in case)

worked for me.

@BogdanB98
Copy link

Hello everyone! I'm facing the same problem that I can't solve. Have you solved it? Please e-mail to me [email protected] and we can discuss more. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants