GithubHelp home page GithubHelp logo

bugsnag / cocoapods-bugsnag Goto Github PK

View Code? Open in Web Editor NEW
7.0 29.0 3.0 49 KB

A CocoaPods plugin to integrate bugsnag into your project workspace

Home Page: https://docs.bugsnag.com/platforms/ios/symbolication-guide/

License: MIT License

Ruby 100.00%
bugsnag platforms

cocoapods-bugsnag's Introduction

cocoapods-bugsnag

A CocoaPods plugin for integrating Cocoa projects with Bugsnag, an error tracking and resolution tool. When installed, the plugin will add a Run Script build phase to your project workspace to upload your dSYM files so the Bugsnag service can provide you with symbolicated stack traces.

Installation

cocoapods-bugsnag is available via RubyGems. To install, run:

gem install cocoapods-bugsnag

Installing from Source

  1. Clone this repository
  2. Run bundle install from the root of the repository (installing bundler if needed)
  3. Build the gem using gem build cocoapods-bugsnag.gemspec
  4. Install the gem using gem install cocoapods-bugsnag-<version>.gem

Usage

To add the build phase to your project, add pod 'Bugsnag', and plugin 'cocoapods-bugsnag' to your Podfile:

pod 'Bugsnag'
plugin 'cocoapods-bugsnag'

Then, install with:

pod install

Once added, uploading your dSYM files to Bugsnag will occur automatically.

By default, your Bugsnag API key will either be read from the BUGSNAG_API_KEY environment variable (add an Xcode build setting with this name to set it) or from the :bugsnag:apiKey (or BugsnagAPIKey) value in your Info.plist.

Uploading can be disabled by setting DISABLE_COCOAPODS_BUGSNAG=YES in Xcode's Build Settings or an xcconfig file, or as an argument to xcodebuild.

Support

License

This module is free software released under the MIT License. See LICENSE.txt for details.

cocoapods-bugsnag's People

Contributors

kattrali avatar kylef avatar matthewjhowells avatar nickdowell avatar sethfri avatar steve-nester-uk avatar tomlongridge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sethfri mindole94

cocoapods-bugsnag's Issues

Build fails without BUGSNAG_API_KEY

Describe the bug

cocoapods-bugsnag doesn't play nicely in any situation where the secret BUGSNAG_API_KEY isn't set. There are many situations where the builder of the app doesn't have/need to upload dSYMs to Bugsnag: continuous integration servers and contributors trying to build an open source project for development are the two major ones that come to mind.

I would like a way to tell cocoapods-bugsnag that it doesn't need to upload dSYMs for a given build. In fact I really only want the build phase to run on Archive builds. One way to accomplish this would be to add an environment like BUGSNAG_SKIP_UPLOAD_DSYMS similar to what was suggested here. Another potential solution would be to check to see if the build is a release build and abort the script if it isn't.

Steps to reproduce

  1. Install cocoapods-bugsnag in a repository where your secret BUGSNAG_API_KEY isn't committed to git.
  2. Try to build your Xcode project on a continuous integration server that doesn't know your secret BUGSNAG_API_KEY.
  3. The build will fail because BUGSNAG_API_KEY isn't set.

Environment

  • Ruby version: 2.6.6
  • Bundler version: 1.17.2
  • CocoaPods version: 1.11.2

Missing Step

The script first tries to find the api key this way

api_key = ENV["BUGSNAG_API_KEY"]

but I can't find any tutorials or installation docs that say we need to add an Environment variable named BUGSNAG_API_KEY and set the value to our key

Then the script tries to get the key from the Info.plist but I also can't find any tutorials or sections in the installation guide that say I should add the api key to my plist

# If not present, attempt to lookup the value from the Info.plist
if !api_key
  default_info_plist_location = Dir.glob("./{ios/,}*/Info.plist").reject {|path| path =~ /build|test/i }
  plist_buddy_response = `/usr/libexec/PlistBuddy -c "print :BugsnagAPIKey" "#{default_info_plist_location.first}"`
  api_key = plist_buddy_response if $?.success?
end

Since there are no instructions to add these values in either of these places, my dSYMs are NOT being uploaded so this plugin doesn't actually work.

Lock the http version when using curl

If you don't lock the http version to 1.1, the uploads will fail for larger files.

It has already been done here
Bulk Upload Script

Also, the upload will fail silently. At least, there should be a warning when the upload doesn't succeed.

Pod install failure

Describe the bug

#framework_paths_by_config['Release'] (cocoapods_bugsnag.rb:104)

This line throws NoMethodError - undefined method 'map' for nil:NilClass upon npx pod-install

Steps to reproduce

  1. Add gem 'cocoapods-bugsnag' to React Native project Gemfile
  2. Add pod 'Bugsnag' to Podfile
  3. Add line plugin 'cocoapods-bugsnag' to Podfile
  4. npx pod-install OR cd ios && pod install

Notes: There are no special framework config paths in our project, all dependencies are installed with this signature

 pod 'Permission-Camera', path: "path/to/Camera.podspec"

We do use use_native_modules and use_frameworks!

The docs for this function (framework_paths_by_config) -- "returns The vendored dynamic artifacts and framework target input and output paths grouped by config."

Unless I'm misunderstanding, #framework_dsym_paths which calls #framework_paths_by_config['Release'] is throwing because we (my company) haven't specified any specific framework paths for "Release" in my Podfile?

Thanks in advance!

Environment

  • Ruby version: ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [arm64-darwin21]
  • Bundler version: 2.1.4
  • CocoaPods version: 1.11.3
Error messages:
NoMethodError - undefined method `map' for nil:NilClass

(cocoapods_bugsnag.rb:104)

Plugin needs tests

It would be great if the plugin had RSpec tests, ideally run on each PR, to make sure that contributors aren't breaking anything (and to make it easier than testing the change manually). The cocoapods-amicable plugin has some good examples of what tests could look like.

Thanks!

Build fails when using Appcenter - "Your Podfile requires that the plugin cocoapods-bugsnag be installed."

Describe the bug

Adding this to assist others who may be having the same issue.

When building via Appcenter, the pod install --repo-update command results in the error:
[!] Your Podfile requires that the plugin cocoapods-bugsnag be installed. Please install it and try installation again.

This is referenced in the issue #21 but I don't believe that issue is occuring in Appcenter.

Steps to reproduce

Follow Bugsnag install documentation, configure Appcenter to build from repo.

Environment

  • Ruby version: N/A
  • Bundler version: N/A
  • CocoaPods version: N/A

Solution

I figured that the error message was accurate and that the plugin simply wasn't being installed. My solution was to add the install command cd ios && sudo gem install cocoapods-bugsnag to an Appcenter post-clone.sh script to ensure this occurs prior to build.

My full script is:

#!/usr/bin/env bash

echo "machine api.mapbox.com login mapbox password ${SDK_REGISTRY_TOKEN}" > ~/.netrc
chmod 0600 /Users/runner/.netrc

CUR_COCOAPODS_VER=`sed -n -e 's/^COCOAPODS: \([0-9.]*\)/\1/p' ios/Podfile.lock`
ENV_COCOAPODS_VER=`pod --version`

# check if not the same version, reinstall cocoapods version to current project's
if [ $CUR_COCOAPODS_VER != $ENV_COCOAPODS_VER ];
then
    echo "Uninstalling all CocoaPods versions"
    sudo gem uninstall cocoapods --all --executables
    echo "Installing CocoaPods version $CUR_COCOAPODS_VER"
    sudo gem install cocoapods -v $CUR_COCOAPODS_VER
else 
    echo "CocoaPods version is suitable for the project"
fi;

#install bugsnag
cd ios && sudo gem install cocoapods-bugsnag

It may be worth adding this scenario and fix to the docs.

How to use that?

Is a build phase supposed to be created?

I have a hard time figuring out how to use that plugin.

I've installed the gem and then did a pod install but no luck yet.

Unable to install plugin

I am cloning a project on a new Mac Mini and running into issues installing this plugin. Running pod install get this error:

[!] Your Podfile requires that the plugin `cocoapods-bugsnag` be installed. Please install it and try installation again.

When I try to install this plugin using gem install cocoapods-bugsnag or sudo gem install cocoapods-bugsnag I get these errors:

๐ŸŒถ  gem install cocoapods-bugsnag
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
๐ŸŒถ  sudo gem install cocoapods-bugsnag
Password:
Building native extensions. This could take a while...
ERROR:  Error installing cocoapods-bugsnag:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20220209-30722-118ktiy.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-ffi_c-dir
	--without-ffi_c-dir
	--with-ffi_c-include
	--without-ffi_c-include=${ffi_c-dir}/include
	--with-ffi_c-lib
	--without-ffi_c-lib=${ffi_c-dir}/lib
	--enable-system-libffi
	--disable-system-libffi
	--with-libffi-config
	--without-libffi-config
	--with-pkg-config
	--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
	from extconf.rb:10:in `system_libffi_usable?'
	from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.5/gem_make.out

Plugin always applies an install hook regardless of the plugin being activated

The CocoaPods plugin will always run it's own custom install hook and apply to the user's Xcode project regardless of the cocoapods-bugsnag plugin being activated within a Podfile.

Steps to Reproduce

  • Install the plugin gem install cocoapods cocoapods-bugsnag.
  • Create an Xcode project and run pod init inside the directory containing Xcode.
  • Run pod install

Expected Results

My user project does not have a Bugsnag hook installed. It should only be activated if I activate the plugin in my Podfile for CocoaPods.

plugin 'cocoapods-bugsnag'

Actual Result

My user project does have a Bugsnag hook installed.

Your Podfile requires that the plugin `cocoapods-bugsnag` be installed.

Hello guys,

I'm having troubles installing it with POD.
In my React-Native project, I'm runned : cd ios/ && gem install cocoapods-bugsnag

My return was:

Successfully installed cocoapods-bugsnag-2.2.1
Parsing documentation for cocoapods-bugsnag-2.2.1
Done installing documentation for cocoapods-bugsnag after 0 seconds
1 gem installed

Then I added to my Podfile:

pod 'Bugsnag'
plugin 'cocoapods-bugsnag'

But when I'm running: pod install
I've this error :

[!] Your Podfile requires that the plugin `cocoapods-bugsnag` be installed. Please install it and try installation again.

and the installation stop...

Could someone help me pls ?

Missing hermes dSYM

Describe the bug

App dSYM is uploaded but missing hermes dSYM

Screenshot 2023-02-06 at 21 00 30

Steps to reproduce

Enable Hermes (default for latest react-native version) and build!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.