question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Error while updating property 'color' in shadow node of type: AndroidTextInput

See original GitHub issue

Describe the bug
Passing color prop to textInputProps on android crashes the app.

com.facebook.react.bridge.JSApplicationIllegalArgumentException Error while updating property 'color' in shadow node of type: AndroidTextInput 
    ViewManagersPropertyCache.java:121 com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp
    ViewManagerPropertyUpdater.java:156 com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty
    ViewManagerPropertyUpdater.java:60 com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps
    ReactShadowNodeImpl.java:319 com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties
    UIImplementation.java:265 com.facebook.react.uimanager.UIImplementation.createView
    UIManagerModule.java:463 com.facebook.react.uimanager.UIManagerModule.createView
    Method.java:-2 java.lang.reflect.Method.invoke
    JavaMethodWrapper.java:372 com.facebook.react.bridge.JavaMethodWrapper.invoke
    JavaModuleWrapper.java:158 com.facebook.react.bridge.JavaModuleWrapper.invoke
    NativeRunnable.java:-2 com.facebook.react.bridge.queue.NativeRunnable.run
    Handler.java:873 android.os.Handler.handleCallback
    Handler.java:99 android.os.Handler.dispatchMessage
    MessageQueueThreadHandler.java:29 com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
    Looper.java:214 android.os.Looper.loop
    MessageQueueThreadImpl.java:232 com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run
    Thread.java:764 java.lang.Thread.run

Caused by: java.lang.ClassCastException java.lang.String cannot be cast to java.lang.Integer 
    ViewManagersPropertyCache.java:294 com.facebook.react.uimanager.ViewManagersPropertyCache$BoxedIntPropSetter.getValueOrDefault
    ViewManagersPropertyCache.java:106 com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp
    ViewManagerPropertyUpdater.java:156 com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty
    ViewManagerPropertyUpdater.java:60 com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps
    ReactShadowNodeImpl.java:319 com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties
    UIImplementation.java:265 com.facebook.react.uimanager.UIImplementation.createView
    UIManagerModule.java:463 com.facebook.react.uimanager.UIManagerModule.createView
    Method.java:-2 java.lang.reflect.Method.invoke
    JavaMethodWrapper.java:372 com.facebook.react.bridge.JavaMethodWrapper.invoke
    JavaModuleWrapper.java:158 com.facebook.react.bridge.JavaModuleWrapper.invoke
    NativeRunnable.java:-2 com.facebook.react.bridge.queue.NativeRunnable.run
    Handler.java:873 android.os.Handler.handleCallback
    Handler.java:99 android.os.Handler.dispatchMessage
    MessageQueueThreadHandler.java:29 com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
    Looper.java:214 android.os.Looper.loop
    MessageQueueThreadImpl.java:232 com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run
    Thread.java:764 java.lang.Thread.run

To Reproduce
Steps to reproduce the behavior:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
N/A

Additional details

  • Device: Google Pixel Simulator; Samsung A6 Device
  • OS: Android 9
  • react-native-picker-select version: 6.3.3
  • react-native version: 16.8.6
  • react version: 0.60.6

Reproduction and/or code sample

      <RNPickerSelect
        style={pickerSelectStyles}
        placeholder={{
          label: `${placeholderText}`,
          value: null
        }}
        key={items.length}
        Icon={() => <PickerIcon color={color} />}
        textInputProps={{
          fontSize: Fonts.size.medium,
          padding: 0,
          margin: 0,
          fontFamily: 'TTCommons-Regular',
          maxFontSizeMultiplier: 1.1,
          color: isEmptyOrNil(value) ? '#C7C7CD' : Colors.black // this causes the issue on android
        }}
        useNativeAndroidPickerStyle={false}
        value={value}
        onValueChange={onValueChange}
        onDonePress={onDonePress}
        items={items}
        disabled={isDisabled}
      />

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ShaharyarMaroofcommented, Mar 25, 2020

@lfkwtz as you suggested, setting the color prop through style on android fixes the issue. thanks!

1reaction
ShaharyarMaroofcommented, Mar 24, 2020

cool, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while updating property 'height' in shadow node of type ...
I am building a simple app and it works fine in the emulator(Genymotioin), but when I run it on real device it shows...
Read more >
Error while updating property 'X' in shadow node of type
The error explains that it expects a variable as integer, and not as a string value. Example. <BarItem barInterval={'5'} /> is wrong, but...
Read more >
Can you add these blocks in thunkable?
Android will automatically crash because the syntax … ... Critical ERROR while updating property 'fontSize' in shadow node of type:RCTTextat.
Read more >
error while updating property 'justifycontent' in shadow node of ...
error while updating property 'justifycontent' in shadow node of type rctview. Without a standalone repro or more context on the places in your...
Read more >
Error while updating property 'height' in shadow node
Error while updating property 'height' in shadow node of type: RCTView when I test on real device, but nothing wrong on emulator ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found