Hi all,
I'm making a Python3/Kivy application for Android/iOS using Buildozer.
It scraps informations from a website with beautifulsoup4 (with a workaround to bypass an error with htmlparser) and show them on screen with Kivy. I also add 4 buttons, 3 for social media purpose (with webbrowser) and one to give a phone number to the mobile phone module (with Plyer).
For that part with Plyer, I'm defining phonecall() who use the call.makecall(tel='number') method. That doesn't work at all and my application crashes on GNU/Linux or Android when I try to add that button bind. Here the message I get on GNU/Linux (you can check my logs for the Android one).
File "/home/guillaume/.local/lib/python3.8/site-packages/plyer/utils.py", line 93, in _ensure_obj
mod = __import__(module, fromlist='.')
ModuleNotFoundError: No module named 'plyer.platforms'
Traceback (most recent call last):
File "main.py", line 194, in <module>
ConceptruelleApp().run()
File "/usr/lib/python3/dist-packages/kivy/app.py", line 800, in run
root = self.build()
File "main.py", line 133, in build
btn1.bind(on_press=phonecall(tel))
File "main.py", line 97, in phonecall
call.makecall(tel=tel)
File "/home/guillaume/.local/lib/python3.8/site-packages/plyer/facades/call.py", line 45, in makecall
self._makecall(tel=tel)
File "/home/guillaume/.local/lib/python3.8/site-packages/plyer/facades/call.py", line 56, in _makecall
raise NotImplementedError()
NotImplementedError
If I comment the btn1.bind() line, my App works perfectly.
Can you help me please ?
btn1.bind(on_press=phonecall(tel))`
btn1.bind(on_press=phonecall)
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/08488fb3-4f11-4fdf-b743-3b21338a2a11o%40googlegroups.com.
Traceback (most recent call last):
File "/home/guillaume/.local/lib/python3.8/site-packages/plyer/utils.py", line 93, in _ensure_obj
mod = __import__(module, fromlist='.')
ModuleNotFoundError: No module named 'plyer.platforms'
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "main.py", line 194, in <module>
ConceptruelleApp().run()
File "/usr/lib/python3/dist-packages/kivy/app.py", line 826, in run
runTouchApp()
File "/usr/lib/python3/dist-packages/kivy/base.py", line 502, in runTouchApp
EventLoop.window.mainloop()
File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 727, in mainloop
self._mainloop()
File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 460, in _mainloop
EventLoop.idle()
File "/usr/lib/python3/dist-packages/kivy/base.py", line 340, in idle
self.dispatch_input()
File "/usr/lib/python3/dist-packages/kivy/base.py", line 325, in dispatch_input
post_dispatch_input(*pop(0))
File "/usr/lib/python3/dist-packages/kivy/base.py", line 231, in post_dispatch_input
listener.dispatch('on_motion', etype, me)
File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
File "/usr/lib/python3/dist-packages/kivy/core/window/__init__.py", line 1360, in on_motion
self.dispatch('on_touch_down', me)
File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
File "/usr/lib/python3/dist-packages/kivy/core/window/__init__.py", line 1376, in on_touch_down
if w.dispatch('on_touch_down', touch):
File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
File "/usr/lib/python3/dist-packages/kivy/uix/widget.py", line 460, in on_touch_down
if child.dispatch('on_touch_down', touch):
File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
File "/usr/lib/python3/dist-packages/kivy/uix/behaviors/button.py", line 151, in on_touch_down
self.dispatch('on_press')
File "kivy/_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch
File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
File "kivy/_event.pyx", line 1138, in kivy._event.EventObservers._dispatch
File "main.py", line 98, in phonecall
call.makecall(tel=tel)
File "/home/guillaume/.local/lib/python3.8/site-packages/plyer/facades/call.py", line 45, in makecall
self._makecall(tel=tel)
File "/home/guillaume/.local/lib/python3.8/site-packages/plyer/facades/call.py", line 56, in _makecall
raise NotImplementedError()
NotImplementedError
A kwarg of the `Widget.bind` method expepts a callable, which will be executed when the button gets pressed. But in your code you bind the `on_press` event to the return value of your `phonecall` function. So for to fix this change the following code line - instead of:`btn1.bind(on_press=phonecall(tel))`
... you should put only the function name without the brackets and the argument:btn1.bind(on_press=phonecall)
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d52b4c98-377a-4b35-821e-94dd15b29c55o%40googlegroups.com.
12-03 17:00:46.478 14459 14561 I python : File "/home/guillaume/Documents/Python/ConcepTruelle_3/.buildozer/android/app/main.py", line 98, in phonecall
12-03 17:00:46.480 14459 14561 I python : File "/home/guillaume/Documents/Python/ConcepTruelle_3/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/conceptruelle/plyer/facades/call.py", line 45, in makecall
12-03 17:00:46.483 14459 14561 I python : File "/home/guillaume/Documents/Python/ConcepTruelle_3/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/conceptruelle/plyer/facades/call.py", line 56, in _makecall
12-03 17:00:46.485 14459 14561 I python : NotImplementedError
12-03 17:00:46.485 14459 14561 I python : Python for android ended.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/d52b4c98-377a-4b35-821e-94dd15b29c55o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/b94b3dfb-73ae-43cf-bfdd-dc4662c3cf22o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/b94b3dfb-73ae-43cf-bfdd-dc4662c3cf22o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/adec134a-65b6-4c1f-ad10-9c4450fd4603o%40googlegroups.com.
I actually recommended to use the master repository of plyer (not kivy)... if this is not helping then I'm out of ideas ...unfortunately I never used plyers call module .. you could try to get support on the discord channel of kivy (https://chat.kivy.org)
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/adec134a-65b6-4c1f-ad10-9c4450fd4603o%40googlegroups.com.
class MakeCallButton(Button):
tel = StringProperty()
def call(self, *args):
call.makecall(tel=self.tel)
import android
from android.permissions import request_permissions, Permission
request_permissions([Permission.CALL_PHONE])