Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes in production only - Android and iOS #487

Open
RGDEV2022 opened this issue Oct 1, 2022 · 23 comments
Open

Crashes in production only - Android and iOS #487

RGDEV2022 opened this issue Oct 1, 2022 · 23 comments

Comments

@RGDEV2022
Copy link

RGDEV2022 commented Oct 1, 2022

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
Copy link
Author

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

@YoannBuzenet
Copy link

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 ?

@cjohnson318
Copy link

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.

@SokolovRU
Copy link

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.

kueda added a commit to inaturalist/iNaturalistReactNative that referenced this issue Nov 30, 2022
@veyselkoru
Copy link

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

@andrewjmac
Copy link

Did anyone manage to solve this? Thanks

@veyselkoru
Copy link

@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

@andrewjmac
Copy link

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

@20chad16
Copy link

Any fix for this?

@diegodsp
Copy link

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

@amanmanhas
Copy link

Facing same problem, any fix?

@amanmanhas
Copy link

@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

@andrewjmac
Copy link

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

@20chad16
Copy link

@andrewjmac @amanmanhas

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

@amanmanhas
Copy link

@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

@andrewjmac
Copy link

andrewjmac commented Jan 22, 2023 via email

@jimmy123A
Copy link

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.

@moak
Copy link

moak commented Apr 14, 2023

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 ?

@jimmy123A
Copy link

jimmy123A commented Apr 14, 2023

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

@Ashwini8088
Copy link

did anyone found solution?

@GeroWalther
Copy link

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?

@felipesilva-plank
Copy link

felipesilva-plank commented Oct 30, 2023

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.

@waleed2000x
Copy link

antdesign for RN works all fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests