React-native-iap: iOS build failed, cannot find IAPPromotionObserver.m

Created on 19 Aug 2020  路  7Comments  路  Source: dooboolab/react-native-iap

Version of react-native-iap

4.5.2, manual installation

Version of react-native

0.59.9

Platforms you faced the error (IOS or Android or both?)

iOS

Expected behavior

build success

Actual behavior

Build failed due to unable to find IAPPromotionObserver.m

This is because IAPPromotionObserver.m is removed in https://github.com/dooboolab/react-native-iap/pull/1039
but it is still referenced in ios/RNIap.xcodeproj/project.pbxproj

Remove that reference will fix the issue.

Tested environment (Emulator? Real Device?)

Steps to reproduce the behavior

Manually install RNIap by adding RNIap.xcodeproj to xcode and build

馃摫 iOS 馃檹 help wanted

Most helpful comment

@danleveille Yes, open /node_modules/react-native-iap/ios/RNIap.xcodeproj in xcode and remove references of IAPPromotionObserver.m / IAPPromotionObserver.h.

Then go back your react native app and now your app can build without the issue.

This issue only occurred if you install RNIap manually by adding RNIap.xcodeproj to your RN project. I think it will not affect user who manually installs RNIap by Podfile.

All 7 comments

@howg0924 Were you able to fix this issue yourself by just removing all of those references in project.pbxproj?

A workaround might be adding IAPPromotionObserver.m file into /node_modules/react-native-iap/ios/IAPPromotionObserver.m

@danleveille Yes, open /node_modules/react-native-iap/ios/RNIap.xcodeproj in xcode and remove references of IAPPromotionObserver.m / IAPPromotionObserver.h.

Then go back your react native app and now your app can build without the issue.

This issue only occurred if you install RNIap manually by adding RNIap.xcodeproj to your RN project. I think it will not affect user who manually installs RNIap by Podfile.

@howg0924 exactly so. no issue using pods

IAPPromotionObserver is removed now in iOS. Feel free to reopen if you still find the issue with the recent version which is 4.6.3.

Believe there's still an issue with 4.6.3 while adding as a Library

clang: error: no such file or directory: '/Users/mac/Sites/eventlivernnew/node_modules/react-native-iap/ios/IAPPromotionObserver.m'
clang: error: no input files

Adding as pod didn't work due to this error:

[!] Unable to find a specification for `React-Core` depended upon by `RNIap`

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

react-native is 0.59.9

Believe there's still an issue with 4.6.3 while adding as a Library

clang: error: no such file or directory: '/Users/mac/Sites/eventlivernnew/node_modules/react-native-iap/ios/IAPPromotionObserver.m'
clang: error: no input files
Adding as pod didn't work due to this error:

[!] Unable to find a specification for React-Core depended upon by RNIap

You have either:

  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.

react-native is 0.59.9

Was this page helpful?
0 / 5 - 0 ratings