Closed tobycox closed 8 years ago
I noticed this too. It looks like the Stripe lib contains symlinks and npm deliberately doesn't support symlinks. I can think of a few options to get this working:
rnpm
here that might work - haven't had a chance to try this yetWhat do you think?
Agree that #2 is probably the way to go for now. Stripe doesn't update their library all that often and it's not critical that it be kept up to date here. The real problem is that there isn't an npm
-type solution to dynamically include non-JS libraries in an npm module!
I think I figured this out. Just released https://github.com/lrettig/react-native-stripe/releases/tag/release_1.0.3 which depends on cocoapods to download and install the Stripe lib. This works for me on my end, give it a shot and let me know if it works! (Note that you'll probably want to completely delete the old module and remove references to it and the Stripe lib from xcode)
After thinking about this some more, option 2. above seemed messy and incorrect to me.
Worked for me! :dancer:
Thanks for testing!
On Fri, Jan 29, 2016 at 12:06 PM, Toby Cox notifications@github.com wrote:
Worked for me! [image: :dancer:]
— Reply to this email directly or view it on GitHub https://github.com/lrettig/react-native-stripe/issues/3#issuecomment-176864824 .
What version of CocoaPods are you using?
On 1.0.0.beta.6 I get the error:
The dependency
Stripeis not used in any concrete target.
On 0.39.0 it won't install for me and gives me a more verbose answer:
Analyzing dependencies
[!] Unable to load a specification for the plugin /usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-deint egrate-1.0.0.beta.1
/usr/local/bin/pod install
CocoaPods : 0.39.0
Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
RubyGems : 2.5.1
Host : Mac OS X 10.11.4 (15E65)
Xcode : 7.3 (7D175)
Git : git version 2.6.4 (Apple Git-63)
Ruby lib dir : /usr/local/Cellar/ruby/2.3.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 8b5591e4d0c4a7ada94aee7a10a1f8675f5f4
1c2
cocoapods-plugins : 0.4.2
cocoapods-search : 0.1.0
cocoapods-stats : 0.6.2
cocoapods-trunk : 0.6.4
cocoapods-try : 0.5.1
pod 'Stripe'
NoMethodError - undefined method `to_ary' for #<Pod::Specification name="Stripe">
Did you mean? to_query
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver/lazy_specification.rb:14:i
n `method_missing'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver.rb:64:in `flatten'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver.rb:64:in `block in resolve
'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver.rb:63:in `tap'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/resolver.rb:63:in `resolve'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:539:in `block
in resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:in `section'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:537:in `resol
ve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:70:in `analyz
e'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:213:in `analyze'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:136:in `block in resol
ve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:in `section'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:135:in `resolve_depend
encies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:105:in `install!'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:71:in `run_insta
ll_with_update'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:101:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/lib/cocoapods/command.rb:47:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-0.39.0/bin/pod:44:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
Hi @jordangarside
Sorry to hear you're having trouble. I'm using 0.39.0. I've installed this on a few computers and never had a problem. Are you able to install other pods?
L
@lrettig Thanks for getting back to me! I just found more information on this, seems to have to do with Ruby and CocoaPods, going to try different versions of Ruby. https://github.com/CocoaPods/CocoaPods/issues/4391
Good luck, let me know if it works out or if you get stuck
On Sat, Apr 9, 2016 at 12:48 AM, Jordan Garside notifications@github.com wrote:
@lrettig https://github.com/lrettig Thanks for getting back to me! I just found more information on this, seems to have to do with Ruby and CocoaPods, going to try different versions of Ruby. CocoaPods/CocoaPods#4391 https://github.com/CocoaPods/CocoaPods/issues/4391
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/lrettig/react-native-stripe/issues/3#issuecomment-207706077
@irettig Yeah so I tried to make CocoaPods use a different version of Ruby with rvm, but for some reason CocoaPods isn't using the global Ruby version.
They fixed this original install issue I was having in the 1.0.0 CocoaPods betas, but the podfile has to be modified so it has to correct target. I'm going to look at trying to get it to work myself for the betas and let you know how it goes. Here's how the syntax changed in CocoaPods 1.0.0.
Thanks!
Thanks for the update! Glad to hear you've made some progress. Let me know if tweaking anything on my end would be helpful!
Lane
On Sat, Apr 9, 2016 at 8:47 PM, Jordan Garside notifications@github.com wrote:
@irettig Yeah so I tried to make CocoaPods use a different version of Ruby with rvm, but for some reason CocoaPods isn't using the global Ruby version.
They fixed this issue in the 1.0.0 CocoaPods betas, but the podfile has to be modified http://stackoverflow.com/questions/34556991/pod-install-displaying-error-in-cocoapods-version-1-0-0-beta-1 so it has to correct target. I'm going to look at trying to get it to work myself for the betas and let you know how it goes.
Thanks!
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/lrettig/react-native-stripe/issues/3#issuecomment-207891713
@irettig I gave up getting this to work. In Cocoapods 1.0.0 you have to specify the target which means you have to know the name of the target. Even when I hard code in the name of the project as the target, and the exact xcode project I get a different error saying NoMethodError - undefined method 'name' for nil:NilClass
.
It ends up being more work for me to get this up and running than just making the manual version/form to support Android and iOS.
Thanks for the project!
Hey @jordangarside thanks again for giving this a shot and especially for reporting back about what you saw. I will absolutely keep these lessons in mind for the future. The decision about whether or not to use cocoapods inside npms is a little unclear to me for reasons like this--if anyone else knows more about this and would like to weigh in, I'm open to learning more about it.
Hi @lrettig I had the same problem as @jordangarside with the Podfile. Your podfile needs a target.
target 'StripeNative' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for StripeNative
pod 'Stripe'
end
For now I will try to add this module manually instead of using the Node Package Manager.
It seems that the framework gets created, but without any symlinks, so linking fails when the project is built.
Is there a better way to include this dependency?