title: Custom notification layout: Bad notification posted from package Couldn't expand RemoteViews
body: <p>I'm getting that disgusting exception when trying to use some custom layout for my notifications. I've cropped the notification to image and 2 TextViews to ease solution finding, but it still won't work. All advices from similar questions didn't help (((</p>
  
  <p>Here's the code from broadcast receiver:</p>
  
  <pre><code>public class ReminderOccurredReceiver extends BroadcastReceiver {
      public ReminderOccurredReceiver() {
      }
  
      @Override
      public void onReceive(Context context, Intent intent) {
          PreferencesWrapper mPrefs = PreferencesWrapper.getWrapper(context);
          boolean uses12HourClock = mPrefs.getIfUse12HourClock();
          Uri soundUri = Uri.parse(mPrefs.getSoundUri());
  
          String serializedReminder = intent.getStringExtra("reminder");
          Reminder reminder = new Gson().fromJson(serializedReminder, Reminder.class);
  
          Intent editIntent = new Intent(context, EditReminderActivity.class);
          editIntent.putExtra("serializedReminder", serializedReminder);
          PendingIntent pEditIntent = PendingIntent.getActivity(context, reminder.getDbId(), editIntent,
              PendingIntent.FLAG_UPDATE_CURRENT);
  
          RemoteViews notificationView = new RemoteViews(context.getPackageName(), R.layout.notification_layout);
          notificationView.setImageViewResource(R.id.notif_image, R.drawable.ic_launcher);
          notificationView.setTextViewText(R.id.notif_message, reminder.getMessage());
          notificationView.setTextViewText(R.id.notif_time, reminder.getFormattedTZTime(uses12HourClock));
  
          NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
              .setAutoCancel(true)
              .setSmallIcon(R.drawable.ic_launcher)
              .setTicker(reminder.getMessage())
              .setContent(notificationView)
              .setContentIntent(pEditIntent);
  //            .setSound(soundUri)
  
          NotificationManager nManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
          nManager.notify(reminder.getDbId(), builder.build());
      }
  }
  </code></pre>
  
  <p>And here's a notification layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="@dimen/notification_height"
      android:padding="3dp"
      &gt;
  
      &lt;ImageView android:id="@+id/notif_image"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerVertical="true"
          /&gt;
  
      &lt;TextView android:id="@+id/notif_message"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_toRightOf="@id/notif_image"
          android:textSize="17sp"
          android:singleLine="true"
          /&gt;
  
      &lt;TextView android:id="@+id/notif_time"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_toRightOf="@id/notif_image"
          android:layout_alignParentBottom="true"
          /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>As you can see - nothing complicated here. Where can a mistake be hidden?</p>
  
  <p>Testing on Nexus4 @ 4.4.4</p>