我知道这个问题已经被问过好几次了。但是没有一个解决方案对我有用。这就是为什么我想再次问这个问题。以下行仅接受NotificationCompat.Builder(context)
:
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, ADMIN_CHANNEL_ID) // Getting error
我已经实现了:
- 输入
android.support.v4.app.NotificationCompat
我的支持库版本高于 25
implementation group: 'com.android.support', name: 'appcompat-v7', version: '27.1.1
'编译&目标sdk高于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 }
但仍然得到错误。我应该怎么做才能解决这个问题?请帮忙。