react-native-text-input-mask: Module 'inputMask' not found

I have upgraded from version 0.8.0 to 1.0.1 and try to build a new version using react-native run-ios however I get the following error:

fatal error: module 'InputMask' not found
@import InputMask;
 ~~~~~~~^~~~~~~~~
1 error generated.

I have manually linked everything btw, as described in the projects readme.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 15

Most upvoted comments

If you are using RN 0.63.x, then try changing your iOS project deployment target from 10->11, and it should work fine.

Hey, I made sure to follow all your instructions, including the comments you linked, and am still getting the issue. To confirm: image Linked the InputMask.framework image libRNTextInputMask.a is at the very bottom, below libRCTText.a

For anyone who had trouble with this, I managed to solve it 😄

Under Libraries find RNTextInputMask.xcodeproj, select it, under its targets select RNTextInputMask then just drag InputMask.xcodeproj -> Products -> InputMask.framework into the Link With Libraries Build Phase.

In my case, it wasn’t there for some strange reason 😦

There seems to be some kind of race issue happening. Even with InputMask.framework and libRNTextInputMask.a below libRCTText.a it randomly fails with the ‘not found’ errors.

Sometimes doing a clean (CMD+Shift+K) and then build, it works. Then after that successful build, run the build again and it fails with the error ‘Module ‘inputMask’ not found’ in RNTextInputMask.h even though nothing has changed in code nor the order of the items in the Linked Frameworks and Libraries list.

This is with React Native 0.59.9 and react-native-text-input-mask version 1.0.1 on XCode 10.2.1.

Back in XCode 10.1 with react-native-text-input-mask version 0.7.0 on RN 0.55.4 this didn’t happen.

my case is done, just use YourProject.xcworkspace and violaa

The following Xcode settings worked for me (tested on iOS device running iOS 12.1):

Project -> Target -> Build Settings -> Build Options -> Set Always Embed Swift Standard Libraries to “Yes”

It’s work fine in simulator. but not work in real device

Hey man, I don’t know what I did to fix it, it seems to be an issue everytime my node_modules moves around.

It just happened to me again this morning.

My steps of messing around include:

  1. Cleaning Build :: Product -> Clean (cmd+shft+k)
  2. Rebooting
  3. Removing the InputMask.framework from the Embedded Binaries and re-dragging it in.
  4. Ensuring the libRNTextInputMask.a is near the bottom, or atleast below libRCTText.a

And honestly, some of these steps didn’t even work the first time I tried, it took doing it a few times for it to finally work. It’s a bizarre issue and I have no clue what causes it or how to fix it. It just eventually fixes itself for me.

Good luck 😦 Sorry I can’t be of much more help