40

All of a sudden, a project that used to run well on iOS simulator no longer works. Whenever I try switching to the custom keyboard, I get two errors:

1) plugin com.XXX.XXX.KeyBoardName interrupted

2) plugin com.XXX.XXX.KeyBoardName invalidated

I tried resetting the simulator, rebooting Xcode, etc. - everything to no avail. Happy to provide more details if helpful!

Edit:-
I am using this sample code https://github.com/bjhstudios/iOSCustomKeyboard.
The above sample is working fine. The problem is when I switch the keyboards between native and custom, after some time, I get this error is log and suddenly, custom keyboard disappear. Then, again, I have to go to Simulator Settings and add the custom keyboard.

Faysal Ahmed
  • 7,501
  • 5
  • 28
  • 50
vk2015
  • 1,118
  • 1
  • 12
  • 16
  • 3
    @Piyush Dubey can you add more specific information about your project? Hard to diagnose without more info… – buildsucceeded Jun 04 '16 at 10:28
  • Longshot, but if you used any cocoapods. Have you checked that you have the latest version as well as all pods are updated to latest? – the_pantless_coder Jun 04 '16 at 17:18
  • @PiyushDubey Found the solution. Please check it out :D – Coder1000 Jun 05 '16 at 09:45
  • I have added some more information. Please check it. – Piyush Dubey Jun 06 '16 at 09:18
  • @PiyushDubey Where do these additional informations come from? You're not the OP... – Eric Aya Jun 06 '16 at 11:24
  • @EricD Yes, I am not the OP. I apologize for adding information. But, I am facing same problem and I have just explained the scenario(more information), as asked by members. Should I remove additional information? – Piyush Dubey Jun 06 '16 at 11:52
  • @PiyushDubey You've added a bounty, so you should probably let it be now. :p But in the future I think it's better to write your own question (and if necessary refer to another one by link) because we don't know if OP here would be ok with this addition - and I feel it's *slightly* off-topic considering the original question (but yeah, no big issue either, just saying). – Eric Aya Jun 06 '16 at 11:55
  • 1
    @EricD I'll keep this thing in mind. And I think OP would not have any problem because he would have faced the issue and might be waiting for answer. Anyways, thanks for the information. :) – Piyush Dubey Jun 06 '16 at 12:00
  • @PiyushDubey Yes, but you are about to waste a 50 rep bounty unless you award it to someone. – Coder1000 Jun 09 '16 at 12:03
  • @Coder1000 Yes, I know about that. But, how I award a bounty, if any answer is not useful to me? – Piyush Dubey Jun 09 '16 at 12:37
  • @Coder1000 Thanks for letting me know about your choice. But, I can go it to waste, if it didn't help me. I appreciate the efforts putting by the person by answering the question, but that's not enough I believe. And I can see why you're asking me to award a bounty, even if that answer didn't work for me or someone else. – Piyush Dubey Jun 09 '16 at 13:00
  • @PiyushDubey It's quite obvious indeed. But I needed to know so I could know if I would delete my answer or not. Have a nice day :) – Coder1000 Jun 09 '16 at 14:11
  • @PiyushDubey- Reset simulator then delete Derived data then Can you please write the custom Keyboard switching code on the main thread and then try.it will work. – Devendra Agnihotri Apr 23 '19 at 19:25

1 Answers1

1

The problem is in your code, i have faced with this too. Look at my old code

let keyboardNib = UINib(nibName: "ChatCustomKeyboardView", bundle: nil)
customKeyboardView = keyboardNib.instantiateWithOwner(self, options: nil)[0] as! UIView
view.addSubview(customKeyboardView)

Then i changed it to this

let nib = UINib(nibName: "ChatCustomKeyboardView", bundle: nil)
let objects = nib.instantiateWithOwner(self, options: nil)
view = objects[0] as! UIView;

and everything start working. So try to assign your view but not add as subview.

Bohdan Savych
  • 3,310
  • 4
  • 28
  • 47
  • I experienced that, instantiateWithOwner take more time to load nib as our custom keyboard view and app crash before nibbling load.. I used **let nibViews = Bundle.main.loadNibNamed("vwKeyboard", owner: self, options: nil) keyboardView = nibViews?.first as! UIView keyboardView.frame.size = view.frame.size self.view.addSubview(keyboardView)** It response quicker than nib.instantiateWithOwner – Anjali jariwala Aug 21 '18 at 12:05