NativeBase: Button.js theme backgroundColor: null crashing on RN 0.59.1 Android NoSuchKey Exception: backgroundColor
I have gone through these following points
- Check latest documentation: https://docs.nativebase.io/
- Check for existing open/closed issues for a possible duplicate before creating a new issue: https://github.com/GeekyAnts/NativeBase/issues
- Use the latest NativeBase release: https://github.com/GeekyAnts/NativeBase/releases
- Check examples from NativeBase KitchenSink https://github.com/GeekyAnts/NativeBase-KitchenSink
- For discussion purpose make use of NativeBase Slack: http://slack.nativebase.io/
- For queries related to theme, check Theme Variables from Docs and live NativeBase Theme Editor http://nativebase.io/customizer/
Issue Description
node, npm, react-native, react and native-base version, expo version if used, xcode version
RN . 0.59.1 Android… native-base 2.12.1
Expected behaviour
Using custom theme via ejectTheme.js should work on iOS and Android.
Actual behaviour
Android release crashing with error: NoSuchKeyException backgroundColor when using transparent and/or disabled style for Button… native-base-theme/components/Button.js has multiple background: null entries… changing these to background: transparent appears to resolve isssue.
Steps to reproduce
Is the bug present in both iOS and Android or in any one of them?
only Android, only release
Any other additional info which would help us debug the issue quicker.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 8
- Comments: 21 (4 by maintainers)
Commits related to this issue
- Fix transparent button crashes on Expo Android backgroundColor:null causes crash on Expo android, changed to 'transparent'. #2673 — committed to hcw12889/NativeBase by hcw12889 5 years ago
this definitely needs an urgent fix,
<Button transparent />totally breaks at the moment.Fixed in #2799. Will be available with the next version.
Temporary workaround:
Guys, changing all instances of backgroundColor:null to backgroundColor:“transparent” in the Buttons.js native-base-theme solved my issue… in case you ejected the theme
Please try our latest release v.2.12.5.
The fix right now is adding style with backgroundColour: ‘transparent’ Its very annoying @SupriyaKalghatgi decided to not bother with this simple fix
For us it was line 177 of the native base theme file native-base/components/Button.js
Changing it to backgroundColor: ‘transparent’ resolves it for us.
@SupriyaKalghatgi whats happening with your organization?
[eng] also crashes with such parameters in the Button component
<Button transparent dark>{this.props.children}</Button>one by one, the props data works fine, everything falls together[rus] также же крушится при таких параметрах в компонент Button
<Button transparent dark>{this.props.children}</Button>по одиночке данные props нормально работает, вместе все падает@dguillamot if you change any
backgroundColor: nulltobackgroundColor: 'transparent', it fixes the issue