Android Oreo Notification Crashes System UI

前端 未结 3 1660
我寻月下人不归
我寻月下人不归 2021-01-01 19:54

I\'ve managed to get notifications working in older API\'s, but not Oreo. Creating the notification causes my app to still work fine (no messages in logcat), however SystemU

相关标签:
3条回答
  • 2021-01-01 20:13

    The issue is related to new adaptive icons in Android O.

    To solve it, just replace all adaptive icons with classic icons. No matter if mipmap or drawable

    Some references: Link 1 Link 2

    0 讨论(0)
  • 2021-01-01 20:16

    My app was crashing when I tried to create a notification. For my case, I was using an Android Studio sample project, "Basic Activity" that contained the AndroidManifest.xml below. The mipmap/ic_launcher and mipmap/ic_launcher_round are used as app icon.

    <application
        android:name=".DriveMeApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
    

    The project contains ic_launcher.xml and ic_launcher_round.xml adaptive icons above. I had to delete both of the files to resolve my crashing issue. After the adaptive icon files are deleted, the png files should be used as app icon.

    0 讨论(0)
  • 2021-01-01 20:20

    Switch from mipmap to drawable for the icon. See this issue for more.

    0 讨论(0)
提交回复
热议问题