iosxcodereact-nativein-app-purchasereact-native-iap

RNIap.modulemap not found when trying to generate an archive in xcode using react-native-iap


I am getting the following error when trying to generate an archive. In debug mode everything is okay.

/Users/user/Library/Developer/Xcode/DerivedData/put_front-cxlwjnwhdvccvwbcghdsniiuvqfe/Build/Intermediates.noindex/ArchiveIntermediates/put_front/IntermediateBuildFilesPath/put_front.build/Release-iphoneos/put_front.build/DerivedSources/put_vers.c module map file '/Users/anis/Library/Developer/Xcode/DerivedData/put_front-cxlwjnwhdvccvwbcghdsniiuvqfe/Build/Intermediates.noindex/ArchiveIntermediates/put_front/BuildProductsPath/Release-iphoneos/RNIap/RNIap.modulemap' not found

and this is the content of the file put_vers.c

 extern const unsigned char ____VersionString[];
 extern const double ____VersionNumber;

 const unsigned char ____VersionString[] __attribute__ ((used)) = "@(#)PROGRAM:put PROJECT:put_front-1" "\n";
 const double ____VersionNumber __attribute__ ((used)) = (double)1.;

Expected Behavior:

Archive should be successfully generated

Environment:

react-native-iap: 12.10.7 react-native: 0.71.8 Platforms (iOS, Android, emulator, simulator, device): IOS, Xcode

Steps to reproduce the behavior:

  1. install react-native-iap
  2. cd ios && pod install
  3. try to generate archive from xcode

I tried to link the library manually. I added pod 'RNIap', :path => '../node_modules/react-native-iap' to Podfile. but nothing worked

EDIT: if running the app with yarn ios from terminal, the build is successful and the app is working on debug mode on simulator and real device, but if running it from xcode i'm getting the same error.


Solution

  • Make sure you opened xxx.xcworkspace file with xcode, not xxx.xcodeproje.