question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Notification for android not working [ Drawable.icon ]

See original GitHub issue

I’m building an android app in buildozer with plyer. It seems that the notification don’t work. My simple code for notification using plyer:

notification.notify(title='WARNING!', message='This is a sample warning!')

It works on my computer but when I built it for android and run it on my phone, the app crashes when it tries to send a notification. It says that there’s no attribute icon for the app in _set_icons.py. I tried to look into it, but I don’t know what should I do.

buildozer.spec

requirements = python3,kivy,plyer,android

logs

09-21 15:40:00.332 18207 18233 I python : File “/home/masterjoseph/notif-test/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/notificationtest/plyer/platforms/android/notification.py”, line 100, in _set_icons 09-21 15:40:00.332 18207 18233 I python : AttributeError: type object ‘com.test.notification.R$drawable’ has no attribute ‘icon’ 09-21 15:40:00.332 18207 18233 I python : Python for android ended.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
masterjoseph914commented, Oct 7, 2021

PR is now merged and the issue is now fixed! Thank y’all. ❤️

1reaction
masterjoseph914commented, Sep 28, 2021

It should be fixed in plyer sources.

Hello, you are right. I reopened the issue and edited my last comment. Thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Icon not displaying in notification, white square shown instead
Right-click on your res folder > New > Image Asset. You will then see Configure Image Assets as shown in the image below....
Read more >
Android: Notification Icons - OneSignal Documentation
Navigate to Messages > New Push > Platform Settings > Google Android Options > Set the icon name without the file extension. With...
Read more >
Create a Notification - Android Developers
The following example shows how to create a notification with the following: A small icon, set by ... setSmallIcon(R.drawable.notification_icon)
Read more >
Drawable resources - Android Developers
A drawable resource is a general concept for a graphic that can be drawn to the screen and which you can retrieve with...
Read more >
Adaptive icons - Android Developers
To add an adaptive icon to your app, update the android:icon attribute in your app manifest to specify a drawable resource. You may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found