I know this question has been asked several times before. But none of the solutions worked for me. That's why I would like to ask the question again. The following line only accepts NotificationCompat.Builder(context)
:
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, ADMIN_CHANNEL_ID) // Getting error
I have fulfilled:
- importing
android.support.v4.app.NotificationCompat
My support libraries version is above 25
implementation group: 'com.android.support', name: 'appcompat-v7', version: '27.1.1
'Compile & Target sdk is above 25
android { compileSdkVersion(27) buildToolsVersion '27.0.3' flavorDimensions 'default' dataBinding { enabled = true } defaultConfig { applicationId('something') minSdkVersion(16) targetSdkVersion(27) versionCode(1) versionName('1.0.0') testInstrumentationRunner('android.support.test.runner.AndroidJUnitRunner') multiDexEnabled true }
But still getting the error. What should I do to fix this? Please help.