Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS version will not build #462

Closed
akyker20 opened this issue Apr 24, 2019 · 8 comments
Closed

iOS version will not build #462

akyker20 opened this issue Apr 24, 2019 · 8 comments
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS

Comments

@akyker20
Copy link

Version of react-native-iap

2.4.9

Version of react-native

0.57.4

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

ios

Expected behavior

Not fail to build in xcode

Actual behavior

Fails to build in xcode

Tested environment (Emulator? Real Device?)

Read Device

Steps to reproduce the behavior

I followed steps in the readme
Screen Shot 2019-04-23 at 10 04 46 PM

@josesn
Copy link

josesn commented Apr 24, 2019

have the same issue
i followed all steps from the readme
Error: E_IAP_NOT_AVAILABLE

@benfurkankilic
Copy link

I updated react-native-iap@2.3.23 and solved

@josesn
Copy link

josesn commented Apr 24, 2019

@kilicfurkan
It works! Thank you

@akyker20
Copy link
Author

@josesn What version of react-native and react-native-iap are you using? I changed to react-native-iap@2.3.23 and now I am getting Build input file cannot be found: '/Users/austinkyker/projects/bagszn/bagszn/node_modules/react-native-iap/ios/IAPPromotionObserver.m'

@josesn
Copy link

josesn commented Apr 24, 2019

@akyker20
react-native : 0.57.7
react-native-iap : 2.3.23

@benfurkankilic
Copy link

@josesn What version of react-native and react-native-iap are you using? I changed to react-native-iap@2.3.23 and now I am getting Build input file cannot be found: '/Users/austinkyker/projects/bagszn/bagszn/node_modules/react-native-iap/ios/IAPPromotionObserver.m'

You can add 'IAPPromotionObserver.m' file manually like this: facebook/react-native#19569 (comment)

@hyochan hyochan added 🙏 help wanted Extra attention is needed 📱 iOS Related to iOS labels Apr 25, 2019
@hyochan
Copy link
Member

hyochan commented Apr 25, 2019

@akyker20 Mostly, these kinds of issues are not actually related to the module itself. Please see more information on linking issue in react-native itself.

@hyochan hyochan closed this as completed Apr 25, 2019
@barzhomi
Copy link

barzhomi commented Apr 25, 2019

I had the same issue today when I've added one more person to the project and he has executed a command pod install on a clean environment (without pod source cached) and on Xcode older than 10.2. You can reproduce that issue by executing pod cache clean 'RNIap' --all , then install pods again and try to build project.

There are two reasons why that happened:

  1. the first one that the podspec source parameter points to the master branch (I'm using old version of react-naive-iap library), but not to a certain tag or commit. The master branch is constantly updating, thus such podspec doesn't freeze the version of iOS related code , and in some moment it could become incompatible with JS code of the library or even with version of iOS SDK.
  2. the second one that class SKPaymentDiscount appears only in iOS SDK 12.2 and doesn't supported in previous versions of iOS SDK. Xcode usually ships together with new version of iOS SDK and do not provide that sdk for old versions of Xcode. In many case, for example mine, developer can't upgrade Xcode version right when it released.

To resolve this issue I recommend to use modern API availability checks (namely @available) for code uses SKPaymenDiscount . But also I strongly recommend don't use dynamic point for source parameter in podspec such as some branch, and instead of it use the tag with the same name as npm package has (simply replace :tag => "stable" on :tag => package['version'] in podspec file) and create tags in GitHub repository together with new npm package version.

If that will be suitable I could provide pull request for these recommendations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS
Projects
None yet
Development

No branches or pull requests

5 participants