TypeError: Win platform does not support Android Toast

269 views
Skip to first unread message

Robin Barrett

unread,
Feb 19, 2024, 10:39:06 PM2/19/24
to kivy-...@googlegroups.com
Using kivyMD v. 1.1.1 (or 1.2.0)  'toast' from 'kivymd.toast' worked perfectly across Windows, IOS and Android, however after upgrading the Windows kivyMD to v. 2.0.1.dev0 the line

from kivymd.toast import toast
now fails with under Windows with:-

   File "C:\Users\robin\AppData\Local\Programs\Python\Python31013\lib\site-packages\kivymd\toast\androidtoast.py", line 47, in <module>
     raise TypeError(
 TypeError: Win platform does not support Android Toast

Is there an easy way around the problem or is this a bug introduced in kivyMD 2.0.1.dev0 ?

If it's a bug, which version of kivyMD is the best to go for ? (1.2.0 contains a bug under Android I'm searching for a way around)
 

elli...@cox.net

unread,
Feb 19, 2024, 11:25:11 PM2/19/24
to kivy-...@googlegroups.com
Looking at the kivymd docs, the example for toast has the following comment:

# Will be automatically used native implementation of the toast # if your application is running on an Android device. # On desktop use `MDSnackbar < https://kivymd.readthedocs.io/en/latest/components/snackbar/>`_


From: kivy-...@googlegroups.com <kivy-...@googlegroups.com> on behalf of Robin Barrett <robinba...@gmail.com>
Sent: Monday, February 19, 2024 7:38 PM
To: kivy-...@googlegroups.com <kivy-...@googlegroups.com>
Subject: [kivy-users] TypeError: Win platform does not support Android Toast
 
--
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/CAEC4aXUO3%2BqrJ1ncK_MSdhd-T_B_v4qu_qFUwc0qzvcwm2ARKw%40mail.gmail.com.

Robin Barrett

unread,
Feb 19, 2024, 11:39:33 PM2/19/24
to kivy-...@googlegroups.com
OK, thanks very much. (although I preferred the 1.2.0 implementation where platform-specific code was not required :-)

I'm immediately finding a lot of differences between 1.2.0 and 2.0.1.dev0, to the point I'm worried that a 're-write' of my app might be necessary. Given that 2.0.1.dev0 is not advertised as a stable release one has to wonder if its best to just stick with 1.2.0 until v2 is marked as stable.

(Differences so far are replacement of MDTabsBase class, presumably necessitating re-writing of tab code, relocation of button classes... and I've just started.)

 

Reply all
Reply to author
Forward
0 new messages