NotificationCompat.Builder missing build () method

I want to do exactly what it does: Android notification at the moment But in my AlarmReceiver class I have an error: the build () method is undefined for the type NotificationCompat.Builder, in the line: mNotificationManager.notify (1, mBuilder.build ( ));

There is a similar code on the Android developer site, but the same error appears ( http://developer.android.com/training/notify-user/build-notification.html ).

Any help is greatly appreciated.

+4
source share
2 answers

You may be in an older version of the Android Support Package. Make sure your project has a current copy of android-support-v4.jar or android-support-v13.jar in libs/ .

+10
source

It looks like there is a broken version of the Android support package. In particular, the one currently deployed to ActionBarSherlock .

I would recommend always using the latest version of android-support-v4.jar from the Android SDK. You will find it in [android-sdk]/extras/android/support/v4 .

+4
source

Source: https://habr.com/ru/post/1491649/


All Articles