react-native-keyboard-input icon indicating copy to clipboard operation
react-native-keyboard-input copied to clipboard

Errors with RN 0.46.*

Open Mindaugas-Jacionis opened this issue 8 years ago • 11 comments

I've tried to run demo app with react-native v0.46.2 and v0.46.3, but in both cases got an error:

/Users/mindaugasjacionis/Desktop/react-native-keyboard-input/node_modules/react-native-keyboard-tracking-view/lib/KeyboardTrackingViewManager.m:185:39: error: no visible @interface for 'RCTTextField' declares the selector 'setInputAccessoryView:'
            [((RCTTextField*)subview) setInputAccessoryView:[ObservingInputAccessoryView sharedInstance]];
             ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~

Any ideas for quick fix? :)

Mindaugas-Jacionis avatar Jul 17 '17 13:07 Mindaugas-Jacionis

Hey @Mindaugas-Jacionis, thanks for reporting about this issue.

This library wasn't yet tested or made compatible with RN 0.46. It's very much possible that changes were made in RN that needs some adjustments, but I can't exactly tell when this will happen since internally we still don't use RN 0.46.

The quickest fix at the moment would be to downgrade to RN 0.44.2. RN 0.45 might also work but I haven't tested it so I can't tell you for sure.

artald avatar Jul 17 '17 13:07 artald

Hey, I've tested with RN 0.45.1 - all was good. :) I skipped RN 0.45.1 in my project as it had major issues with iOS(release build related). 0.46.1 and 0.46.2 had issues as well, but 0.46.3 is now stable. Anyway, I will keep an eye on this package(too bad cannot help with code, as Objective C is not on my skills list).

Thanks for quick response! :)

Mindaugas-Jacionis avatar Jul 18 '17 07:07 Mindaugas-Jacionis

I rely heavily on this repo for my app, is there any ETA when this will be finished?? I really need this.

sportsbench avatar Jul 20 '17 12:07 sportsbench

RN v-0.45.1 does not work for me I still get this exact error

sportsbench avatar Jul 20 '17 12:07 sportsbench

@sportsbench according to @Mindaugas-Jacionis, it works with RN 0.45.1. Maybe you need to clear the native project cache and relaunch it.

You said that you rely on this package heavily, which RN version have you been using until now?

artald avatar Jul 20 '17 13:07 artald

I was using RN V-0.44.0 until yesterday when I realized that I needed a function for my SectionList only used starting in versions 0.45 and up.

sportsbench avatar Jul 20 '17 13:07 sportsbench

I think I finally got it to work and now something else is broken. It seems like more of a RN-Core problem not this repo's problem though so Ill consider it "working" for 0.45.1 now.

sportsbench avatar Jul 20 '17 13:07 sportsbench

@sportsbench cool, i will update when I know something new about a fix. Usually we don't have too much time handling RN upgrade issues until we upgrade our own internal projects. sorry..

artald avatar Jul 20 '17 13:07 artald

+1

bduyng avatar Aug 12 '17 18:08 bduyng

I am not sure I understand why you are not upgrading your internal projects... without doing so this repo becomes quite useless...

It's been a month and theres still no fix here. How long until you guys switch?

sportsbench avatar Aug 18 '17 12:08 sportsbench

@artald Just wondering if there's any update on this? Also may have some more context for you:

RN 0.48.3

//  RCTCustomInputController.m


RCT_EXPORT_METHOD(presentCustomInputComponent:(nonnull NSNumber*)inputFieldTag params:(nonnull NSDictionary*)params)
{
...
if ([inputField isKindOfClass:[RCTTextView class]])
  {
      UITextView *textView = [inputField valueForKey:@"textView"]; // <====== THIS IS THE LINE THAT's FAILING
      if (textView != nil)
      {
          helperView.inputAccessoryView = textView.inputAccessoryView;
      }
  }
...

}

That line crashes my app with the error:

Exception '[<RCTTextView 0x7fbd10f754c0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key _textView.' was thrown while invoking presentCustomInputComponent on target CustomInputController with params

** However **

If I change the above line from:

UITextView *textView = [inputField valueForKey:@"textView"]; 

to

UITextView *textView = nil;

It looks like the next code block handles that case and everything seems to work as expected.

Hope that helps!

jemise111 avatar Sep 20 '17 15:09 jemise111