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

Button.js theme backgroundColor: null crashing on RN 0.59.1 Android NoSuchKey Exception: backgroundColor #2673

Closed
dguillamot opened this issue Apr 19, 2019 · 21 comments
Assignees

Comments

@dguillamot
Copy link

@dguillamot dguillamot commented Apr 19, 2019

I have gone through these following points

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.

@SupriyaKalghatgi

This comment has been minimized.

Copy link
Collaborator

@SupriyaKalghatgi SupriyaKalghatgi commented Apr 22, 2019

Need Steps to reproduce

@jmcneese

This comment has been minimized.

Copy link

@jmcneese jmcneese commented Apr 22, 2019

@dguillamot if you change any backgroundColor: null to backgroundColor: 'transparent', it fixes the issue

@SupriyaKalghatgi

This comment has been minimized.

Copy link
Collaborator

@SupriyaKalghatgi SupriyaKalghatgi commented Apr 26, 2019

Any backgroundColor: null? which file?

@dguillamot

This comment has been minimized.

Copy link
Author

@dguillamot dguillamot commented Apr 29, 2019

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.

@AmeerHamzaRiaz

This comment has been minimized.

Copy link

@AmeerHamzaRiaz AmeerHamzaRiaz commented Apr 30, 2019

When passing transparent property to button, it crashes.

image

@Jlexyc

This comment has been minimized.

Copy link

@Jlexyc Jlexyc commented May 1, 2019

The same issue I have. Trying to get why. iOS works.
It happened after i've updated to RN 0.59.1

@jeveloper

This comment has been minimized.

Copy link

@jeveloper jeveloper commented May 15, 2019

I think its disabled property that crashes it.

i passed disabled transparent small

@artshevtsov

This comment has been minimized.

Copy link

@artshevtsov artshevtsov commented May 22, 2019

I am also facing this issue on Android 7.0 (Samsung Galaxy A3) real device.
App crashes when I open screen with disabled Button, because of "backgroundColor: null," at native-base-theme/components/Button.js:85 (const buttonTheme)

"native-base": "^2.12.0",
"react": "^16.8.3",
"react-native": "^0.59.8"
05-21 17:09:58.659  5983  6115 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
05-21 17:09:58.659  5983  6115 E AndroidRuntime: Process: com.company.appName, PID: 5983
05-21 17:09:58.659  5983  6115 E AndroidRuntime: com.facebook.react.bridge.NoSuchKeyException: backgroundColor
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.bridge.ReadableNativeMap.getValue(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.bridge.ReadableNativeMap.getValue(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.bridge.ReadableNativeMap.getInt(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.uimanager.av.a(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.uimanager.l.a(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.uimanager.l.a(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.uimanager.aj.a(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.uimanager.aj.a(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.uimanager.UIManagerModule.createView(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:751)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:95)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source)
05-21 17:09:58.659  5983  6115 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:762)
@jeveloper

This comment has been minimized.

Copy link

@jeveloper jeveloper commented May 22, 2019

The fix right now is adding style with backgroundColour: 'transparent'
Its very annoying @SupriyaKalghatgi decided to not bother with this simple fix

@venkatmithun

This comment has been minimized.

Copy link

@venkatmithun venkatmithun commented Jun 3, 2019

have the same issue

@tattivitorino

This comment has been minimized.

Copy link

@tattivitorino tattivitorino commented Jun 3, 2019

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

@venkatmithun

This comment has been minimized.

Copy link

@venkatmithun venkatmithun commented Jun 4, 2019

The fix right now is adding style with backgroundColour: 'transparent'
Its very annoying @SupriyaKalghatgi decided to not bother with this simple fix

this is adding a border around button

@Vadimushka

This comment has been minimized.

Copy link

@Vadimushka Vadimushka commented Jun 4, 2019

[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 нормально работает, вместе все падает

@ivnnv

This comment has been minimized.

Copy link

@ivnnv ivnnv commented Jun 11, 2019

this definitely needs an urgent fix, <Button transparent /> totally breaks at the moment.

@jeveloper

This comment has been minimized.

Copy link

@jeveloper jeveloper commented Jun 11, 2019

@SupriyaKalghatgi whats happening with your organization?

hcw12889 added a commit to hcw12889/NativeBase that referenced this issue Jul 3, 2019
backgroundColor:null causes crash on Expo android, changed to 'transparent'. GeekyAnts#2673
@kpheasey

This comment has been minimized.

Copy link

@kpheasey kpheasey commented Jul 10, 2019

Temporary workaround:

<Button transparent style={{backgroundColor: 'transparent'}}>
@Iamhere

This comment has been minimized.

Copy link

@Iamhere Iamhere commented Jul 11, 2019

To remove a border around button: style={{backgroundColor: 'transparent', elevation: 0}}

@helielson

This comment has been minimized.

Copy link

@helielson helielson commented Jul 20, 2019

I'm facing the same problem. @SupriyaKalghatgi any updates here?

@sanketsahusoft

This comment has been minimized.

Copy link
Collaborator

@sanketsahusoft sanketsahusoft commented Jul 22, 2019

@sankhadeeproy007

This comment has been minimized.

Copy link
Collaborator

@sankhadeeproy007 sankhadeeproy007 commented Jul 23, 2019

Fixed in #2799. Will be available with the next version.

@PlabanJr

This comment has been minimized.

Copy link
Collaborator

@PlabanJr PlabanJr commented Aug 16, 2019

Please try our latest release v.2.12.5.

@PlabanJr PlabanJr closed this Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.