CocoaPods / cocoapods-acknowledgements

CocoaPods plugin that generates a plist which includes the installation metadata
MIT License
111 stars 17 forks source link

NameError on pod install #31

Closed miklselsoe closed 8 years ago

miklselsoe commented 8 years ago

I'm trying to migrate from the post install script to the cocoapods-acknowledgements plugin. When I run pod install I get this error:

NameError - uninitialized constant Class::UI
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/sources_manager.rb:170:in `const_missing'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements/plist_generator.rb:69:in `license_text'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements/plist_generator.rb:21:in `block in generate'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements/plist_generator.rb:17:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements/plist_generator.rb:17:in `generate'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements.rb:66:in `block (4 levels) in <module:CocoaPodsAcknowledgements>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements.rb:63:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements.rb:63:in `block (3 levels) in <module:CocoaPodsAcknowledgements>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements.rb:60:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements.rb:60:in `block (2 levels) in <module:CocoaPodsAcknowledgements>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/user_interface.rb:63:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-acknowledgements-1.1.1/lib/cocoapods_acknowledgements.rb:52:in `block in <module:CocoaPodsAcknowledgements>'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/hooks_manager.rb:109:in `call'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/hooks_manager.rb:109:in `block (3 levels) in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/user_interface.rb:141:in `message'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/hooks_manager.rb:103:in `block (2 levels) in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/hooks_manager.rb:101:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/hooks_manager.rb:101:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/user_interface.rb:141:in `message'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/hooks_manager.rb:100:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer.rb:473:in `run_plugins_post_install_hooks'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer.rb:454:in `perform_post_install_actions'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/installer.rb:121:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/command/install.rb:37:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/lib/cocoapods/command.rb:50:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.0.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

My podfile looks like this:

source 'git@github.com:CocoaPods/Specs.git'

plugin 'cocoapods-acknowledgements', :settings_bundle => true

platform :ios,'9.0'
use_frameworks!
inhibit_all_warnings!

def shared_pods
    pod 'Kingfisher', '~> 2.4.1'
    pod 'SwiftyJSON', '~> 2.3'
    pod 'Locksmith', '~> 2.0.8'
    pod 'DTMarkdownParser', '~> 0.2.2'
    pod 'Changeset', '~> 1.0.5'
    pod 'ReachabilitySwift', '~> 2.3.3'
    pod 'IHKeyboardAvoiding', '~> 2.5'

    pod 'Crashlytics', '~> 3.7.0', :configurations => ['Debug', 'Testing']
end

target 'Target1' do
    shared_pods
end

target 'Target2' do
    shared_pods
end

It seems it may have something to do with reading one of the license files? Or?

marcelofabri commented 8 years ago

Sorry for taking so long to look at this. It really seems that the plugin isn't able to read one of the licenses and it'd warn about it (https://github.com/CocoaPods/cocoapods-acknowledgements/blob/master/lib/cocoapods_acknowledgements/plist_generator.rb#L69), but it couldn't find the class responsible for logging.

So, we have at least one bug: the plugin is crashing when trying to warn in license_text.

We may have another bug if the license really exists. Can you try to make a small reproducible Podfile with the "culprit" dependency so we can check it it's really a bug?

Thanks for filling this.

miklselsoe commented 8 years ago

I too apologize on the long response time. The upside is that I found out what caused the issue.

The pod Changeset in version 1.0.5 refers to a license file that doesn't exist. If this pod is included in the Podfile, cocoapods-acknowledgements fails. Here's a sample project: https://www.dropbox.com/s/kllubwefk8805ar/cocoapods_issue.zip?dl=1