MindscapeHQ / raygun4reactnative

ReactNative crash reporting SDK for Raygun
MIT License
3 stars 3 forks source link

yarn install fails on zsh shell #62

Closed luciancic closed 8 hours ago

luciancic commented 2 years ago

Just wanted to document this to save others time potentially. Feel free to close this.

I tried installing this lib on our project and that failed. My default shell is zsh. I tried with bash and it worked.

The install command with the error:

lucian@my-mac myproject % yarn add raygun4reactnative
yarn add v1.22.10
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
warning " > @react-native-community/checkbox@0.5.7" has unmet peer dependency "react-native-windows@>=0.62".
warning " > @react-native-community/datetimepicker@3.2.0" has unmet peer dependency "react-native-windows@>=0.62".
warning " > @react-native-community/masked-view@0.1.10" has incorrect peer dependency "react@^16.0".
warning "react-native-codegen > jscodeshift@0.11.0" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning " > react-native-paper@4.7.2" has unmet peer dependency "react-native-vector-icons@*".
warning "react-native-paper > @callstack/react-theme-provider@3.0.5" has incorrect peer dependency "react@^16.3.0".
warning "react-native-picker-select > @react-native-picker/picker@1.9.11" has incorrect peer dependency "react@^16.0".
warning " > react-redux@7.2.3" has unmet peer dependency "redux@^2.0.0 || ^3.0.0 || ^4.0.0-0".
warning " > redux-persist@6.0.0" has unmet peer dependency "redux@>4.0.0".
warning " > tailwindcss@2.1.1" has unmet peer dependency "autoprefixer@^10.0.2".
warning " > eslint-config-airbnb@18.2.1" has unmet peer dependency "eslint-plugin-react-hooks@^4 || ^3 || ^2.3.0 || ^1.7.0".
[4/4] πŸ”¨  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ raygun4reactnative@1.2.2
info All dependencies
└─ raygun4reactnative@1.2.2
$ cd ios && pod install
Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Installing unimodules:
 expo-application@3.1.2 from ../node_modules/expo-application/ios
 expo-constants@10.1.3 from ../node_modules/expo-constants/ios
 expo-error-recovery@2.1.0 from ../node_modules/expo-error-recovery/ios
 expo-file-system@11.0.2 from ../node_modules/expo-file-system/ios
 expo-font@9.1.0 from ../node_modules/expo-font/ios
 expo-image-loader@2.1.1 from ../node_modules/expo-image-loader/ios
 expo-image-picker@10.1.4 from ../node_modules/expo-image-picker/ios
 expo-keep-awake@9.1.2 from ../node_modules/expo-keep-awake/ios
 expo-permissions@12.0.1 from ../node_modules/expo-permissions/ios
 expo-splash-screen@0.10.2 from ../node_modules/expo-splash-screen/ios
 expo-structured-headers@1.0.1 from ../node_modules/expo-structured-headers/ios
 expo-updates@0.5.4 from ../node_modules/expo-updates/ios
 unimodules-app-loader@2.1.0 from ../node_modules/unimodules-app-loader/ios
 unimodules-barcode-scanner-interface@6.1.0 from ../node_modules/unimodules-barcode-scanner-interface/ios
 unimodules-camera-interface@6.1.0 from ../node_modules/unimodules-camera-interface/ios
 unimodules-constants-interface@6.1.0 from ../node_modules/unimodules-constants-interface/ios
 unimodules-core@7.1.0 from ../node_modules/@unimodules/core/ios
 unimodules-face-detector-interface@6.1.0 from ../node_modules/unimodules-face-detector-interface/ios
 unimodules-file-system-interface@6.1.0 from ../node_modules/unimodules-file-system-interface/ios
 unimodules-font-interface@6.1.0 from ../node_modules/unimodules-font-interface/ios
 unimodules-image-loader-interface@6.1.0 from ../node_modules/unimodules-image-loader-interface/ios
 unimodules-permissions-interface@6.1.0 from ../node_modules/unimodules-permissions-interface/ios
 unimodules-react-native-adapter@6.2.2 from ../node_modules/@unimodules/react-native-adapter/ios
 unimodules-sensors-interface@6.1.0 from ../node_modules/unimodules-sensors-interface/ios
 unimodules-task-manager-interface@6.1.0 from ../node_modules/unimodules-task-manager-interface/ios

Auto-linking React Native modules for target `myproject`: RNCAsyncStorage, RNCCheckbox, RNCMaskedView, RNCPicker, RNDateTimePicker, RNGestureHandler, RNReanimated, RNSVG, RNScreens, RNTestFlight, raygun4reactnative, react-native-image-picker, react-native-image-resizer, react-native-netinfo, react-native-safe-area-context, and react-native-signature-capture
Analyzing dependencies

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command

/usr/local/bin/pod install


### Report

* What did you do?

* What did you expect to happen?

* What happened instead?

### Stack

CocoaPods : 1.10.1 Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21] RubyGems : 3.0.3.1 Host : macOS 12.4 (21F79) Xcode : 13.4.1 (13F100) Git : git version 2.32.1 (Apple Git-133) Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib Repositories : trunk - CDN - https://cdn.cocoapods.org/


### Plugins

cocoapods-deintegrate : 1.0.4 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.0 cocoapods-trunk : 1.5.0 cocoapods-try : 1.2.0


### Podfile

```ruby
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'myproject' do
  use_unimodules!
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  if !ENV['CI']
    # use_flipper!({ 'Flipper' => '0.80.0' })

    post_install do |installer|
      flipper_post_install(installer)
    end
  end
end

Error

LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi.rb:5:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.14.0/lib/ethon.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:440:in `download_typhoeus_impl_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:372:in `download_and_save_with_retries_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:365:in `download_file_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:338:in `download_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:284:in `ensure_versions_file_loaded'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/cdn_source.rb:208:in `search'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/source/aggregate.rb:83:in `select'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/source/aggregate.rb:83:in `search'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:416:in `create_set_from_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:385:in `find_cached_set'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:360:in `specifications_for_dependency'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:165:in `search_for'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:274:in `block in sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:267:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:267:in `sort_by'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:267:in `sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:53:in `block in sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:70:in `with_no_such_dependency_error_handling'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:52:in `sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:754:in `push_state_for_requirements'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:746:in `require_nested_dependencies_for'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:729:in `activate_new_spec'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:686:in `attempt_to_activate'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+tried%3A+%27%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle%27+%28mach-o+file%2C+but+is+an+incompatible+architecture+%28have+%27x86_64%27%2C+need+%27arm64e%27%29%29+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.3%2Flib%2Fffi_c.bundle&type=Issues

If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods... Searching for inspections failed: undefined method `map' for nil:NilClass error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

miquelbeltran commented 8 hours ago

The issue is caused by:

Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3

and

LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi_c.bundle

This is because it is trying to install a library that is not compatible with arm64 macbooks (M1 and later), probably due to your cocoapods install (zsh may be using a different install than bash?).

The recommendation I see online is installing cocoapods with brew, e.g. https://stackoverflow.com/a/74292067