react-native-picker-select icon indicating copy to clipboard operation
react-native-picker-select copied to clipboard

Crashes in production only - Android and iOS

Open RGDEV2022 opened this issue 2 years ago • 23 comments

Describe the bug
Works in the Expo Go simulator for both Android and iOS. But crashes in production for both. On iOS, it crashes when you try to open the picker. On Android it crashes before opening a component that has the picker import.

To Reproduce

  1. Use the basic setup guide to setup a test picker.
  2. Open the component in a production version of the application.

Expected behavior
Should behave the same as when tested inside the simulator with no crashes.

Screenshots
n/a.

Additional details

  • Device: Android and iOS - Tested multiple devices with same issue.
  • OS: Any iOS or Android version (Tested in iOS 16 and Android 10, 11)
  • react-native-picker-select version: 8.0.4
  • react-native version: 0.68.2
  • expo sdk version: 45

Reproduction and/or code sample

<RNPickerSelect
      value={props.value}
      placeholder={props.placeholder}
      textInputProps={{ multiline: props.multiline }}
      pickerProps={{ numberOfLines: 10 }}
      useNativeAndroidPickerStyle={false}
      style={{
        inputIOS: {
          fontSize: 14,
          minHeight: 40,
          paddingLeft: 10,
          paddingRight: 10,
          borderRadius: 4,
          backgroundColor: 'white',
          shadowColor: '#000',
          shadowOffset: { width: 0, height: 1 },
          shadowOpacity: 0.1,
          shadowRadius: 5,
          elevation: 5
        },
        inputAndroid: {
          fontSize: 14,
          minHeight: 40,
          paddingLeft: 10,
          paddingRight: 10,
          borderRadius: 4,
          backgroundColor: 'white',
          shadowColor: '#000',
          shadowOffset: { width: 0, height: 1 },
          shadowOpacity: 0.1,
          shadowRadius: 5,
          elevation: 5
        }
      }}
      onValueChange={(value) => props.setValue(value)}
      items={props.items}
    />

RGDEV2022 avatar Oct 01 '22 19:10 RGDEV2022

Here's an issue I saw describing the same stack trace I receive for the error https://stackoverflow.com/questions/65741312/react-native-project-crashes-only-on-ios-release-build-when-using-picker

RGDEV2022 avatar Oct 01 '22 19:10 RGDEV2022

Having the same problem here, everything works well on Expo and xCode. On production it crashes when the picker is opened.

DId you find a way ?

YoannBuzenet avatar Oct 24 '22 20:10 YoannBuzenet

Can confirm that this SO resolution does not work for this problem. If anyone has pointers on how to fix this, that would be great.

cjohnson318 avatar Nov 08 '22 21:11 cjohnson318

Hello everyone. Today I faced this problem. Initially, the array that I passed to the object was empty and I filled it with a request to the server. On emulators and launching through expo - everything is cool! But when I did the build, the application crashed.

By poking, I realized that it was necessary to pass an initially non-empty array, filled it with local data and then updated it. The component started working.

If this is relevant to you, please describe it.

SokolovRU avatar Nov 21 '22 21:11 SokolovRU

On Expo it causes this error mentioned below "Invariant Violation: requireNativeComponent: "RNCAndroidDialogPicker" was not found in the UIManager."

veyselkoru avatar Dec 14 '22 12:12 veyselkoru

Did anyone manage to solve this? Thanks

andrewjmac avatar Jan 07 '23 17:01 andrewjmac

@andrewjmac Remove react-native-picker-select and use only @react-native-picker/picker it's not working well together. I gave up to use it and I wrote my own picker

veyselkoru avatar Jan 09 '23 07:01 veyselkoru

@veyselkoru Thanks for the reply, I've done just that!

andrewjmac avatar Jan 09 '23 09:01 andrewjmac

Any fix for this?

20chad16 avatar Jan 18 '23 23:01 20chad16

Same problema here, the app crashes only on production at the both iOS and Android systems!

diegodsp avatar Jan 19 '23 14:01 diegodsp

Facing same problem, any fix?

amanmanhas avatar Jan 20 '23 14:01 amanmanhas

@20chad16 @diegodsp I solved this problem by passing placeholder={ label: '', value: '' } like this. I am getting error because I am passing null in placeholder label placeholder={ label: null, value: null, }

I don't know why I am not getting this error in development May be this is your problem

amanmanhas avatar Jan 20 '23 18:01 amanmanhas

@amanmanhas Did this solve it in the production build? That fix works in development but didn't in production for me.

andrewjmac avatar Jan 20 '23 19:01 andrewjmac

@andrewjmac @amanmanhas

I just added a placeholder and am receiving the same error on an iPhone with testflight

20chad16 avatar Jan 21 '23 01:01 20chad16

@amanmanhas Did this solve it in the production build? That fix works in development but didn't in production for me.

Yes, it's fixed for me in production also

amanmanhas avatar Jan 22 '23 04:01 amanmanhas

Out of curiosity what version of android have you tested your production on? I think it was fine on older versions but kept breaking for me on new ones.

Thanks, Andy

On 22 Jan 2023, at 04:01, amanmanhas @.***> wrote:



@amanmanhashttps://github.com/amanmanhas Did this solve it in the production build? That fix works in development but didn't in production for me.

Yes, it's fixed for me in production also

— Reply to this email directly, view it on GitHubhttps://github.com/lawnstarter/react-native-picker-select/issues/487#issuecomment-1399398442, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACE6XWPDDM7EVJVWK3QR5LLWTSWI5ANCNFSM6AAAAAAQ2SBPFE. You are receiving this because you were mentioned.Message ID: @.***>

andrewjmac avatar Jan 22 '23 08:01 andrewjmac

It appears that this package internally uses @react-native-community/picker. I solved this after installing this lib.

It works in Expo Go because this library is supported by default, but the pod wasn't natively linked this is why the app was crashing.

jimmy123A avatar Apr 13 '23 23:04 jimmy123A

It appears that this package internally uses @react-native-community/picker. I solved this after installing this lib.

It works in Expo Go because this library is supported by default, but the pod wasn't natively linked this is why the app was crashing.

crashes for me even with @react-native-picker/picker installed 🤔 , which version do you use of the renamed library @react-native-picker/picker ?

moak avatar Apr 14 '23 02:04 moak

@moak I'm using the latest version. Did you make sure to rebuild the native app after installing the lib?

jimmy123A avatar Apr 14 '23 21:04 jimmy123A

did anyone found solution?

Ashwini8088 avatar Jun 01 '23 09:06 Ashwini8088

I also have the same issue! It works on Expo Go but not in production. empty string instead of null in placeholder did also not work for me. should I get @react-native-community/picker ? Or can you guys recommend another library?

GeroWalther avatar Jun 16 '23 22:06 GeroWalther

it worked for me on IOS after installing @react-native-picker/picker, but still crashes on android. I am using expo 0.10.13 and eas cli for build.

felipesilva-plank avatar Oct 30 '23 13:10 felipesilva-plank

antdesign for RN works all fine!

waleed2000x avatar Apr 16 '24 09:04 waleed2000x