reactjs - 反应原生推送通知
问题描述
我正在处理本机推送通知并在我的 build.gradle 文件中配置 fcm
我收到错误
> Task :react-native-device-info:compileReleaseJavaWithJavac
Note: E:\IOOLABS\Projects\mobeApp\mobeApp\node_modules\react-native-device-info\android\src\main\java\com\learnium\RNDeviceInfo\RNDeviceModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :react-native-fcm:compileReleaseJavaWithJavac
Note: E:\IOOLABS\Projects\mobeApp\mobeApp\node_modules\react-native-fcm\android\src\main\java\com\evollu\react\fcm\SendNotificationTask.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :react-native-i18n:compileReleaseJavaWithJavac
Note: E:\IOOLABS\Projects\mobeApp\mobeApp\node_modules\react-native-i18n\android\src\main\java\com\AlexanderZaytsev\RNI18n\RNI18nModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :react-native-video:compileReleaseJavaWithJavac
Note: E:\IOOLABS\Projects\mobeApp\mobeApp\node_modules\react-native-video\android\src\main\java\com\brentvatne\react\ReactVideoViewManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
这里是 app/build.gradle 配置
dependencies {
compile project(':react-native-fcm')
compile 'com.google.firebase:firebase-core:10.0.1' //this decides your firebase SDK version
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile project(':react-native-config')
compile project(':react-native-sound')
compile project(':react-native-vector-icons')
compile project(':react-native-video')
compile project(':react-native-file-chooser')
compile project(':react-native-audio')
compile project(':react-native-image-picker')
compile project(':react-native-i18n')
compile project(':react-native-device-info')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.facebook.react:react-native:+'
}
和 android build.gradle 文件是
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// PLEASE DO NOT CHANGE GRADLE VERSION
classpath 'com.google.gms:google-services:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
帮我解决它
解决方案
你试过jetify吗?
First, use Android Studio's refactoring tool to convert your app re: the Android developer docs
npm install --save-dev jetifier
npx jetify
npx react-native run-android (your app should correctly compile and work)
Call npx jetify run in the postinstall target of your package.json (Any time your dependencies update you have to jetify again)
欲了解更多信息:
推荐阅读
- javascript - 从函数外部调用变量不起作用javascript
- mysql - PyroCMS(Laravel)翻译中的where子句无法正常工作
- python - Pandas 分组然后根据日期范围 +/- x-days 计数和求和
- python - pandas 中的 scatter_matrix 返回大量文本 - 如何删除它?
- notifications - PWA 通知
- angular - 是否可以设置
来自打字稿Angular 5的文本颜色 - python - 我无法理解,为什么只有 delete_node 不起作用
- android - 当应用程序在后台运行时调用 onMessage 方法
- c# - 如何在 Angular 中实现区域
- c# - Unity Number 向导返回按钮