can't find referenced method 'android.app.NotificationChannel getNotificationChannel(java.lang.String)' in library class android.app.NotificationManager

What is causing these warnings in GRADLE ?

 

Warning:com.urbanairship.push.notifications.NotificationFactory: can't find referenced method 'android.app.NotificationChannel getNotificationChannel(java.lang.String)' in library class android.app.NotificationManager
Warning:com.urbanairship.push.notifications.NotificationFactory: can't find referenced class android.app.NotificationChannel
Warning:com.urbanairship.push.notifications.NotificationFactory: can't find referenced method 'void createNotificationChannel(android.app.NotificationChannel)' in library class android.app.NotificationManager
Warning:com.urbanairship.push.notifications.NotificationFactory: can't find referenced class android.app.NotificationChannel
Warning:there were 4 unresolved references to classes or interfaces.
Warning:there were 2 unresolved references to library class members.

 

I am using 8.8.4 sdk and gradle 3.4.1

 

Is this from me using something that is not in the library when I extend the NotificationFactory I get the method to override. What am I doing wrong ? 

---

@Nullable
@Override
public Notification createNotification(@NonNull PushMessage message, int notificationId) {

//builds the notification
NotificationCompat.Builder builder = new NotificationCompat.Builder(getContext())
.setContentTitle("TITLE") // TODO LOOK AT Current Design for messages .
.setContentText(message.getAlert())
.setAutoCancel(true)
.setSmallIcon(R.drawable.notification_icon);

// Notification Action buttons
builder.extend(new ActionsNotificationExtender(getContext(), message, notificationId));

return builder.build();
}

Didn't find what you were looking for?

New post

Comments

4 comments

  • Sean,

    Is it possible to see what your build.gradle looks like?

    The errors seem to be pointing out that it can't find any of the methods in the NotificationChannel class. 

    I'd be curious to know if you're compiling against API 26, which is where those methods primarily come from, so it might not be finding those.

    Additionally, while not entirely relevant for those warnings, you may wish to update your UA SDK to 8.9.6 just to make sure you're on the latest.

    Comment actions Permalink
    0
  • Thank you , Yeah I saw in my Oreo notes that was a new feature on the channel specifics. We are not ready to build to 26 yet so that would also be why I didn't see this warning when using the demo I made of the sample project .

    Comment actions Permalink
    0
  • If it helps any, you can downgrade to 8.5.1 of the UA SDK, as that is the last version that compiles against API 25, so that may resolve that issue if you're just looking to test.

    Comment actions Permalink
    0
  • Comment actions Permalink
    0

Please sign in to leave a comment.