我正在尝试将react-native-firebase添加到我的react本机项目中,我已经按照android https://rnfirebase.io/docs/v5.x.x/installation/android官方文档中给出的所有步骤进行操作
但仍然出现错误,缺少以下方法:
notificationChannelGroup.getDescription() ,
notificationChannelGroup.setDescription(description)
notificationManager.getNotificationChannelGroup(channelGroupId)
我已经尝试更改我的SDK版本,构建工具版本和目标SDK版本,如以下链接中所述: https://github.com/invertase/react-native-firebase/issues/1759
下面是我当前的项目react和firebase版本:
"react-native": "^0.59.2",
"react-native-firebase": "^5.2.2",
android / build.gradle版本:
buildscript {
ext {
//buildToolsVersion = "27.0.3" //previous version
buildToolsVersion = "28.0.3" //modified
minSdkVersion = 16
//compileSdkVersion = 27 //previous version
compileSdkVersion = 28 //modified
// targetSdkVersion = 26 //previous
targetSdkVersion = 28 //modified
// supportLibVersion = "27.1.1" //previous
supportLibVersion = "28.0.0" // modfied
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
// classpath 'com.google.gms:google-services:3.0.0' //old version
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
android / app / build.gradle相关性:
dependencies {
implementation project(':react-native-firebase')
// Firebase dependencies
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.8"
implementation 'com.google.firebase:firebase-messaging:17.5.0'
}
apply plugin: 'com.google.gms.google-services'
请告诉我,react-native-firebase是否能在Android上正常工作。
谢谢。