Notificare / notificare-sdk-react-native

Notificare's Official React Native Module
MIT License
6 stars 0 forks source link

🐞: Crash after updating to RN 0.73.6 #67

Closed jarnove closed 5 months ago

jarnove commented 5 months ago

Is there an existing issue for this?

Describe the bug

After updating from RN 0.72.9 to 0.73.6 and overwriting the build with the newer version the app keeps crashing on Android. This happens in both debug and client builds.

It crashes when "Notificare.launch();" is called. If I put this in comment, no crash happens. Starting from a clean sheet and clean install a build, no crash happens.

Errors in debug build:

Image2

Errors in client (/enterprise) build:

Image1

Any idea?

Steps to reproduce

  1. Overwriting the app with 0.72.9 as RN version by a build with RN version 0.73.6.
  2. App crashes on "Notificare.launch();"

Expected behaviour

No crash should happen.

Relevant log output

Output react-native info

System:
  OS: macOS 14.3
  CPU: (10) arm64 Apple M1 Pro
  Memory: 89.05 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.1
    path: ~/.asdf/installs/nodejs/18.20.1/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.5.0
    path: ~/.asdf/plugins/nodejs/shims/npm
  Watchman:
    version: 2024.04.08.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/jarnoverreyt/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK:
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11567975
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /Users/jarnoverreyt/.asdf/shims/javac
  Ruby:
    version: 3.1.1
    path: /Users/jarnoverreyt/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Library version

3.8.0

Operating system

Android 14

React Native version

0.73.6

Smartphone model

No response

Additional context

No response

hpinhal commented 5 months ago

Hi @jarnove,

This report is somewhat conflicting. Commenting out launch() would only have an impact on the second crash/screenshot you shared, as it would prevent that code from running. This first crash you shared takes place during the native app's initialisation process. It runs far before reaching your launch() invocation.

Both crashes seem to be related to code minification. The crashes should be consistent regardless of upgrading or doing a clean install.

We're trying to reproduce what you described, so far to no avail. It would help if you could share your build.gradle files. It may provide additional insight.

It would also definitely help if you could provide us with a minimal app that exhibits this problem.

jarnove commented 5 months ago

Hmm think I found a link.

Saw this configuration in my app/ build.gradle.

configurations.all {
   resolutionStrategy.force ‘androidx.work:work-runtime:2.7.1’ // Notifee depends on 2.8.0 but Notificare depends on 2.7.1
}

Updated this to 2.9.0 and now it's working as expected. But it's not clear to me if I still need this?

hpinhal commented 5 months ago

Notificare 3.8.0 uses version 2.9.0 of the AndroidX Work Manager. To answer your question, you may not need the resolution strategy if Notifee updated its dependencies and no longer has a conflict. You can remove the resolution strategy and verify which version of the work manager is resolved for your application.