java – Crash when using ConstraintLayout in Notification-ThrowExceptions

Exception or error:

I get an InflationException when I use a ConstraintLayout in a custom Notification. I can use them elsewhere in my app, just not in a custom layout for a Notification. I’m assuming that any widget contained in a support library simply can’t be used in a RemoteView, but I can’t find any confirmation on that. Does anybody know?

E/StatusBar: couldn't inflate view for notification
android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class
Caused by: java.lang.ClassNotFoundException: Didn't find class "" on path: DexPathList[[],nativeLibraryDirectories=[/system/priv-app/TeleService/lib/arm64, /system/fake-libs64, /system/priv-app/TeleService/TeleService.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /system/lib64, /vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(
    at java.lang.ClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    at android.view.LayoutInflater.createView(
    at android.view.LayoutInflater.createViewFromTag(
    at android.view.LayoutInflater.createViewFromTag(
    at android.view.LayoutInflater.inflate(
    at android.view.LayoutInflater.inflate(
    at android.widget.RemoteViews.inflateView(
    at android.widget.RemoteViews.-wrap1(Unknown Source:0)
    at android.widget.RemoteViews$AsyncApplyTask.doInBackground(
    at android.widget.RemoteViews$AsyncApplyTask.doInBackground(
    at android.os.AsyncTask$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$
E/AndroidRuntime: FATAL EXCEPTION: main
Process:, PID: 9732 Bad notification posted from package Couldn't inflate contentViewsandroid.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class
    at android.os.Handler.dispatchMessage(
    at android.os.Looper.loop(
    at java.lang.reflect.Method.invoke(Native Method)
How to solve:

A RemoteViews object (and, consequently, an App Widget) can support
the following layout classes

  • FrameLayout
  • LinearLayout
  • RelativeLayout
  • GridLayout

And the following widget classes:

  • AnalogClock
  • Button
  • Chronometer
  • ImageButton
  • ImageView
  • ProgressBar
  • TextView
  • ViewFlipper
  • ListView
  • GridView
  • StackView
  • AdapterViewFlipper

Descendants of these classes are not supported.

Read more:


RemoteView can only support the following layout classes:





As mentioned here

Leave a Reply

Your email address will not be published. Required fields are marked *