Search code examples
react-nativeexpococoapods

Pod install does not work with my react-native app


I'm trying to build an app on ios in react native using eas build.

Things goes well except wen it comes to do pod install in the IOS directory. I got this error :

⚠️ react-native-unimodules is deprecated in favor of expo
⚠️ Follow this guide to migrate: https://expo.fyi/expo-modules-migration
Using Expo modules
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
[stderr] 
/usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String: "relative URI: /Users/expo/workingdir/build/node_modules/react-native/third-party-podspecs/Folly.podspec" (FrozenError)
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `report'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:66:in `report_error'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:396:in `handle_exception'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:337:in `rescue in run'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:324:in `run'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/bin/pod:23:in `load'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/bin/pod:23:in `<main>'
[stderr] 
/usr/local/Cellar/ruby@2.7/2.7.5/lib/ruby/2.7.0/uri/generic.rb:1491:in `find_proxy': relative URI: /Users/expo/workingdir/build/node_modules/react-native/third-party-podspecs/Folly.podspec (URI::BadURIError)
[stderr] 
    from /usr/local/Cellar/ruby@2.7/2.7.5/lib/ruby/2.7.0/open-uri.rb:218:in `block in open_loop'
[stderr] 
    from /usr/local/Cellar/ruby@2.7/2.7.5/lib/ruby/2.7.0/open-uri.rb:235:in `block in open_loop'
[stderr] 
    from /usr/local/Cellar/ruby@2.7/2.7.5/lib/ruby/2.7.0/open-uri.rb:233:in `catch'
[stderr] 
    from /usr/local/Cellar/ruby@2.7/2.7.5/lib/ruby/2.7.0/open-uri.rb:233:in `open_loop'
[stderr] 
    from /usr/local/Cellar/ruby@2.7/2.7.5/lib/ruby/2.7.0/open-uri.rb:174:in `open_uri'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/podspec_source.rb:19:in `block in fetch'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:86:in `titled_section'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/podspec_source.rb:11:in `fetch'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:993:in `fetch_external_source'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:972:in `block (2 levels) in fetch_external_sources'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `each'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `block in fetch_external_sources'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:970:in `fetch_external_sources'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/bin/pod:23:in `load'
[stderr] 
    from /usr/local/lib/ruby/gems/2.7.0/bin/pod:23:in `<main>'
pod exited with non-zero code: 1

And this is my Podfile : enter image description here

I'm on expo 44. And my pod version is 1.12.1 on Mac M1. Cacaopods 1.12.1 and ruby 2.6.10

Any ideas ?

Thanks

I've found nothing on google with this type of error for mobile app. So I'm asking here.


Solution

  • To fix this issue, I was using an old version of Ruby, so I downloaded a newer version; I was using Ruby 2.6.10, whereas passing it to 3.0.0 solved it.

    And for the bad URI on Folly, I changed it with this line:

    pod 'RCT-Folly', :podspec => '../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec'
    

    I don't know why—maybe when I've upgrade the project from Expo 39 to Expo 44?—the Folly.podspec disappeared and was replaced with RTC-Folly.podspec.