web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
640 stars 164 forks source link

Android app crashes in production but not during dev mode #252

Closed myt-sheila closed 1 year ago

myt-sheila commented 1 year ago

Current behaviour

The app crashes as soon as I triggered the button to open the DatePickerModal in production, but works fine in expo during development.

I have this in App.js

import { enGB, registerTranslation } from "react-native-paper-dates";
registerTranslation("en", enGB);

And used the modal somewhere like this:

 <DatePickerModal
      locale="en"
      mode="range"
      visible={open}
      onDismiss={onDismiss}
      startDate={range.startDate}
      endDate={range.endDate}
      onConfirm={onConfirm}
/>

Expected behaviour

I expected to see the modal exactly like the one I saw during dev mode.

Your Environment

software version
ios x
android x
react-native 0.69.6
react-native-paper x.x.x
node x.x.x
npm or yarn x.x.x
expo sdk 46.0.0
iM-GeeKy commented 1 year ago

Hi @myt-sheila, this is tough to pin down exactly without having a stack trace or error to help better determine what the exact issue is. A few things to try...

github-actions[bot] commented 1 year ago

Hey! Thanks for opening the issue. Can you provide more information about the issue? Please fill the issue template when opening the issue without deleting any section. We need all the information we can, to be able to help. Make sure to at least provide - Current behaviour, Expected behaviour, A way to reproduce the issue with minimal code (link to snack.expo.dev) or a repo on GitHub, and the information about your environment (such as the platform of the device, versions of all the packages etc.).

github-actions[bot] commented 1 year ago

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository.

myt-sheila commented 1 year ago

The app works fine now after enabling hermes. In my app.json, I specified the values of jsEngine:

    "jsEngine": "hermes", 
    "ios": {
      ...
      "jsEngine": "hermes"
    },
    "android": {
      ....
      "jsEngine": "hermes"
    }, 

Thank you @iM-GeeKy!