标签: react-native-notifications

react-native-notifications 在 iOS 上有效,在 Android 上失败

我已经安装了 react-native-notifications 并且在 iOS 上一切正常,但它在 Android 上一直给我错误。我已经按照这里的确切 Android 安装说明进行操作:https : //wix.github.io/react-native-notifications/docs/installation-android

我的开发流程:

  1. 进行修改。
  2. npx react-native clean-project-auto; npx react-native-clean-project
  3. rm -rf android/app/build; anroid/gradlew clean; android/gradlew build --refresh-dependencies
  4. npx react-native start --reset-cache
  5. Android Studio 使缓存无效/重新启动。
  6. Android Studio 干净构建。
  7. Android Studio 同步 Gradle 文件并运行应用程序。
  8. npx react-native run-android --deviceId emulator-5554

步骤 7. 结果Invariant Violation: PushNotificationManager is not available.(下图)

步骤 8. 产生以下日志:

...

> Task :react-native-notifications:testReactNative60DebugUnitTest

...

com.wix.reactnativenotifications.core.InitialNotificationHolderTest > replacesInitialNotification PASSED

com.wix.reactnativenotifications.core.InitialNotificationHolderTest > isALazySingleton PASSED
WARNING: An illegal reflective access operation has …
Run Code Online (Sandbox Code Playgroud)

java android react-native react-native-notifications

7
推荐指数
1
解决办法
1380
查看次数