HazAT / badge

Add a badge to your app icon
MIT License
966 stars 87 forks source link

Badge warning and errors #60

Closed bhavinmdesai closed 6 years ago

bhavinmdesai commented 7 years ago

Couple of issues:

  1. Getting warning: This action (badge) is deprecated
  2. Build on the CI fails with: Something went wrong while running badge: uninitialized constant Fastlane::Badge::Runner

Please Help! Thanks

Here is the output from Fastlane:


Something went wrong while running badge: uninitialized constant Fastlane::Badge::Runner
--
  | Did you mean?  Fastlane::Runner

$ LANG=en_US.UTF-8 bundle exec fastlane ios ConsumerAppLive
--
  | +-----------------------+---------+-----------+
  | \|                Used plugins                 \|
  | +-----------------------+---------+-----------+
  | \| Plugin                \| Version \| Action    \|
  | +-----------------------+---------+-----------+
  | \| fastlane-plugin-badge \| 1.0.0   \| add_badge \|
  | +-----------------------+---------+-----------+
  |  
  | [21:15:59]: ------------------------------
  | [21:15:59]: --- Step: default_platform ---
  | [21:15:59]: ------------------------------
  | [21:15:59]: Driving the lane 'ios ConsumerAppLive' 🚀
  | [21:15:59]: --------------------------------
  | [21:15:59]: --- Step: clear_derived_data ---
  | [21:15:59]: --------------------------------
  | [21:15:59]: Derived Data path located at: /Users/Rewardle/Library/Developer/Xcode/DerivedData
  | [21:15:59]: Successfully cleared Derived Data ♻️
  | [21:15:59]: ----------------------------------
  | [21:15:59]: --- Step: get_info_plist_value ---
  | [21:15:59]: ----------------------------------
  | [21:15:59]: ----------------------------------
  | [21:15:59]: --- Step: get_info_plist_value ---
  | [21:15:59]: ----------------------------------
  | [21:15:59]: -------------------
  | [21:15:59]: --- Step: badge ---
  | [21:15:59]: -------------------
  | ==========================================
  | This action (badge) is deprecated
  | ==========================================
  |  
  | [21:15:59]: The badge action has been deprecated,
  | [21:15:59]: please checkout the badge plugin here:
  | [21:15:59]: https://github.com/HazAT/fastlane-plugin-badge
  | +-----------------------------------+---------------------+
  | \|                      Lane Context                       \|
  | +-----------------------------------+---------------------+
  | \| DEFAULT_PLATFORM                  \| ios                 \|
  | \| PLATFORM_NAME                     \| ios                 \|
  | \| LANE_NAME                         \| ios ConsumerAppLive \|
  | \| GET_INFO_PLIST_VALUE_CUSTOM_VALUE \| 171005              \|
  | +-----------------------------------+---------------------+
  | [21:16:01]: Something went wrong while running badge: uninitialized constant Fastlane::Badge::Runner
  | Did you mean?  Fastlane::Runner
  |  
  | +------+----------------------+-------------+
  | \|             fastlane summary              \|
  | +------+----------------------+-------------+
  | \| Step \| Action               \| Time (in s) \|
  | +------+----------------------+-------------+
  | \| 1    \| default_platform     \| 0           \|
  | \| 2    \| clear_derived_data   \| 0           \|
  | \| 3    \| get_info_plist_value \| 0           \|
  | \| 4    \| get_info_plist_value \| 0           \|
  | \| 💥   \| badge                \| 0           \|
  | +------+----------------------+-------------+
  |  
  | [21:16:01]: fastlane finished with errors
  |  
  | [!] Something went wrong while running badge: uninitialized constant Fastlane::Badge::Runner
  | Did you mean?  Fastlane::Runner
tutipeti commented 7 years ago

@bhavinmdesai badge() is the action that still exists in fastlane and is deprecated. Once you added the badge plugin to fastlane you'll have to change your code to use add_badge(), as that's the action defined in the plugin you just installed.

elvin-vega commented 6 years ago

I have a similar error when I download in my machine 'fastlane-plugin-badge' version 1.1.0 an execute rake.


| ~/Dev/source/fastlane-plugin-badge-master | => rake ${HOME_DIR}/.rbenv/versions/2.5.1/bin/ruby -I${HOME_DIR}/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-support-3.8.0/lib:${HOME_DIR}/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.8.0/lib ${HOME_DIR}/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.8.0/exe/rspec --pattern spec/**{,/*/**}/*_spec.rb

Fastlane::Actions::AddBadgeAction

run

prints a message (FAILED - 1)

Failures:

1) Fastlane::Actions::AddBadgeAction#run prints a message Failure/Error: Badge::Runner.new.run('.', options)

 NameError:
   uninitialized constant BadgeBridge::Bridge::Badge
   Did you mean?  BadgeBridge::Bridge
 # ./lib/fastlane/plugin/badge/helper/badge_helper.rb:10:in 'run'
 # ./lib/fastlane/plugin/badge/helper/badge_helper.rb:26:in 'run'
 # ./lib/fastlane/plugin/badge/actions/add_badge_action.rb:6:in 'run'
 # ./spec/badge_action_spec.rb:6:in 'block (3 levels) in <top (required)>'

Finished in 0.07637 seconds (files took 2.13 seconds to load) 1 example, 1 failure

Failed examples:

rspec ./spec/badge_action_spec.rb:3 # Fastlane::Actions::AddBadgeAction#run prints a message

${HOME_DIR}/.rbenv/versions/2.5.1/bin/ruby -I${HOME_DIR}/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-support-3.8.0/lib:${HOME_DIR}/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.8.0/lib ${HOME_DIR}/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.8.0/exe/rspec --pattern spec/**{,/*/**}/*_spec.rb failed


| ~/Dev/source/fastlane-plugin-badge-master | => gem list bad*

LOCAL GEMS

badge (0.9.1) fastlane-plugin-badge (1.1.0)


HazAT commented 6 years ago

I am closing this since @tutipeti posted the answer. @elvin-vega Please create a new issue with a proper reproduction case so I can take a look at this issue.