react-native-paper-dropdown icon indicating copy to clipboard operation
react-native-paper-dropdown copied to clipboard

react-native-paper-dropdown crashes expo app on android

Open nibble0101 opened this issue 1 year ago • 16 comments

I started tinkering with React Native Paper recently before stumbling on this package. This package works fine in development. The android project even builds successfully using EAS. Unfortunately, clicking the dropdown crashes the app entirely both on a physical device and emulator. I'm not sure whether the problem is with expo or this project.

You can see it works fine here in development. To reproduce the problem, perhaps follow this guide to build the apk and install it on an emulator or a physical android device.

nibble0101 avatar Sep 01 '24 14:09 nibble0101

hi @nibble0101 can you share the react-native-paper version you are using so i can try to reproduce this.

fateh999 avatar Sep 04 '24 10:09 fateh999

hi @nibble0101 can you share the react-native-paper version you are using so i can try to reproduce this.

Sure! I'm using react-native-paper v5.12.5. Below are the other dependencies.

 "dependencies": {
    "@expo/vector-icons": "^14.0.2",
    "expo": "~51.0.31",
    "expo-checkbox": "~3.0.0",
    "expo-constants": "~16.0.2",
    "expo-status-bar": "~1.12.1",
    "react": "18.2.0",
    "react-native": "0.74.5",
    "react-native-paper": "^5.12.5",
    "react-native-paper-dropdown": "^2.3.1",
    "react-native-safe-area-context": "4.10.5",
    "expo-linking": "~6.3.1",
    "expo-dev-client": "~4.0.25"
  },

nibble0101 avatar Sep 04 '24 10:09 nibble0101

yes, same here development local build works correctly, while eas build generates code with not working select dropdown that crashes the application react native paper 2.3.1

krylov-mihail avatar Sep 08 '24 08:09 krylov-mihail

I am experiencing the same issue. In LogCat I can see the following exception.

Error: Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.

Please read our getting-started guide and make sure you've followed all the required steps.
                                                                                                
https://callstack.github.io/react-native-paper/docs/guides/getting-started


This error is located at:
    in PortalConsumer
    in Portal
    in ThemedComponent
    in Unknown
    in RCTView
    in Unknown
    in Menu
    in ThemedComponent
    in Unknown
    in Dropdown
    in RCTView
    in Unknown
    in RCTView
    in Unknown
    in ThemeProvider
...

And just to be very clear I do have a theme provider at the top of my app.

I also have the same versions as other people above in this post.

HenrikJohnson avatar Sep 10 '24 18:09 HenrikJohnson

Are you guys wrapping the code with both providers?

` <ThemeProvider theme={Theme}> <PaperProvider theme={Theme>

  </PaperProvider>
  </ThemeProvider>

`

@HenrikJohnson @krylov-mihail @nibble0101

fateh999 avatar Sep 10 '24 20:09 fateh999

Are you guys wrapping the code with both providers?

`

  </PaperProvider>
  </ThemeProvider>

`

@HenrikJohnson @krylov-mihail @nibble0101

I'm wrapping only in </PaperProvider.

nibble0101 avatar Sep 11 '24 06:09 nibble0101

same problem for me too, and I'm wrapping with both PaperProvider and ThemeProvider.

SteRiccio avatar Sep 12 '24 20:09 SteRiccio

Seems like the react-native-paper/babel plugin causes this issue. Removing these lines from my babel.config.js fixed it:

env: {
  production: {
    plugins: ["react-native-paper/babel"],
  },
},

I think it's related to this issue here.

Removing these lines increases the bundle size by a lot.

jhoffi avatar Sep 29 '24 11:09 jhoffi

@nibble0101 can you check @jhoffi comment

Seems like the react-native-paper/babel plugin causes this issue. Removing these lines from my babel.config.js fixed it:

env: {
  production: {
    plugins: ["react-native-paper/babel"],
  },
},

I think it's related to this issue here.

Removing these lines increases the bundle size by a lot.

fateh999 avatar Oct 01 '24 06:10 fateh999

Same problem here on Android, removing react-native-paper/babel works normally

gabrielgouv avatar Oct 16 '24 22:10 gabrielgouv

Same problem with iOS. Removing react-native-paper/babel is not a fix I can afford as it increases the bundle size.

yahya-evoly avatar Nov 09 '24 09:11 yahya-evoly

I can confirm this is still an issue, removing the babel plugin isn't really an option.

OneOfOne avatar Jan 07 '25 19:01 OneOfOne

Removed env: { production: { plugins: ['react-native-paper/babel'], }, }, And it worked just fine. I think this is the only solution for now.

sayufu avatar Jan 09 '25 08:01 sayufu

Still running into this issue on ios after TestFlight deployment. Works fine locally and in ios simulator.

MeesterMarcus avatar Feb 05 '25 00:02 MeesterMarcus

Same here on ios and android. The issue is temporarily fixed when removing the babel configuration which should not be the fix for that. when using expo you can reproduce that issue in a simulator by running npx expo --no-dev --minify. When chaning the babel.config.js add the --clear flag to clear the bundler cache beforehand.

LinusOssmann avatar Feb 15 '25 13:02 LinusOssmann

This is an issue for me on iOS using expo 52.0.36 and react-native-paper 5.13.1. Didn't notice until TestFlight as development worked fine.

PaitoAnderson avatar Feb 21 '25 17:02 PaitoAnderson

I'm hoping to release an app in the near future. I'm thankful for the temporary solution to remove react-native-paper/babel, but the increase in bundle size makes this package not feel production ready.

Are there any leads for how we can resolve this?

erockrazor avatar May 14 '25 21:05 erockrazor

I believe this issue has been resolved right? The snack doesn't crash anymore, and I've also not experienced this issue since using it for some weeks. Then maybe close the issue?

foxysolutions avatar Aug 05 '25 20:08 foxysolutions