fermoya / cocoapods-catalyst-support

Ruby extensions to help you configure your pods project so that pods not compiled for Catalyst can still be used for iOS devices
MIT License
111 stars 18 forks source link

Undefined method 'filter' for Array #4

Closed david-young-fax closed 4 years ago

david-young-fax commented 4 years ago

I followed the instruction, downloaded the remove_ios_only_frameworks.rb, and put it the same folder with Podfile.

And here is the modified Podfile:

load 'remove_ios_only_frameworks.rb'

target 'xxx' do use_frameworks!

pod 'PhoneNumberKit', '~> 2.1' pod 'IGRPhotoTweaks', '~> 1.0.0' pod 'Alamofire', '~> 4.7' pod 'SwiftyJSON' pod 'Firebase' pod 'Firebase/Crashlytics' pod 'Firebase/Analytics' pod 'Firebase/DynamicLinks' pod 'FirebaseCore' pod 'SelectionDialog' pod 'Pollfish'

target 'xxxTests' do inherit! :search_paths end

end

def catalyst_unsupported_pods ['IGRPhotoTweaks', 'Firebase', 'Firebase/Crashlytics', 'Firebase/Analytics', 'Firebase/DynamicLinks', 'FirebaseCore', 'SelectionDialog', 'Pollfish'] end

post_install do |installer| installer.configure_support_catalyst end

However, it failed with following message: [!] An error occurred while processing the post-install hook of the Podfile.

undefined method `filter' for #

remove_ios_only_frameworks.rb:330:in configure_support_catalyst' //Documents/xxx/Podfile:35:inblock (2 levels) in from_ruby' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.4.0/lib/cocoapods-core/podfile.rb:179:in post_install!' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/installer.rb:638:inrun_podfile_post_install_hook' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/installer.rb:626:in block in run_podfile_post_install_hooks' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/user_interface.rb:142:inmessage' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/installer.rb:625:in run_podfile_post_install_hooks' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/installer.rb:186:inblock in generate_pods_project' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/user_interface.rb:64:in section' /Users/chenkaty/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/installer.rb:183:ingenerate_pods_project' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/installer.rb:119:in install!' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/command/install.rb:41:inrun' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/claide-1.0.3/lib/claide/command.rb:334:in run' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/lib/cocoapods/command.rb:52:inrun' //.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/cocoapods-1.4.0/bin/pod:55:in <top (required)>' /usr/local/bin/pod:23:inload' /usr/local/bin/pod:23:in `

'

fermoya commented 4 years ago

Hi @david-young-fax , I see you’re using ruby 2.5.0. You need to use ruby 2.6.0 at least, I thought I had this in the Readme, apologies for that. See this link here

fermoya commented 4 years ago

I've updated the README to add a list of requirements.

Let me know if I can help with anything else. I'll close the issue as this issue is related to the Ruby version