The application shows an ongoing notification on start (in certain cases). The application crashes on start sometimes during the app update and it seems that it happens after NotificationManager.notify(…) call.
Fatal Exception: android.app.RemoteServiceException: Bad notification(tag=null, id=30)
posted from <package>, crashing app(uid=10288, pid=28319):
Couldn't inflate contentViewsandroid.view.InflateException:
Binary XML file line #21 in <package:layout>: Error inflating class android.view.View
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1973)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7562)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
The layout file mentioned in the crash message is NOT used as the notification layout. The notification does have a layout file used for RemoteView layout but it inflates ok.
After reading different topics on the internet I think this happens because layout file integer id changes after the app update.
Application build with gradle, minifyEnabled, targetSdk=29, multidex. Crash detected by Crashlytics. Observed on Android 10.
Have anyone met such a problem? Is it possible to fix this situation?