Cocoapods: No such file or directory @ rb_sysopen -- AppCenter -- ReactNative

Created on 2 Oct 2019  路  32Comments  路  Source: CocoaPods/CocoaPods

馃寛

Report

Command

/usr/local/bin/pod install

Report

  • What did you do?
    I ran pod install after I upgraded from react native 0.59.10 to v 0.61.1.

  • What did you expect to happen?
    I expected CocoaPods to successfully install the appcenter pod.

  • What happened instead?
    appcenter was not installed and no pod lockfile was generated.

Stack

   CocoaPods : 1.8.1
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14.5 (18F132)
       Xcode : 10.3 (10G8)
         Git : git version 2.20.1 (Apple Git-117)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ d5888bc829f0f05059cc675d47dcef97f52b9ef9
               trunk - CDN - https://cdn.cocoapods.org/

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.0
cocoapods-try         : 1.1.0

Podfile

platform :ios, '10.0'

require_relative '../node_modules/react-native-unimodules/cocoapods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'Sonder' do
  # Pods for Sonder
  pod 'appcenter', path: '../node_modules/appcenter/ios/appcenter.podspec'
  pod 'appcenter-analytics', path: '../node_modules/appcenter-analytics/ios'
  pod 'appcenter-crashes', path: '../node_modules/appcenter-crashes/ios'
  pod 'appcenter-push', path: '../node_modules/appcenter-push/ios'
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  use_unimodules!

end

Error

Errno::ENOENT - No such file or directory @ rb_sysopen - /Users/connormullins/Sonder/ios/Pods/Local Podspecs/appcenter.podspec.json
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/specification.rb:646:in `read'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/specification.rb:646:in `checksum'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:533:in `block in generate_checksums'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:532:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:532:in `generate_checksums'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-core-1.8.1/lib/cocoapods-core/lockfile.rb:428:in `generate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:744:in `generate_lockfile'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:752:in `write_lockfiles'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:173:in `integrate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/installer.rb:162:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

EXTRA NOTES:
AppCenter was not autolinked when I installed it with npm after upgrading to the most recent version of react native. I manually added the import lines to my Podfile. I am positive though that the appcenter.podspec file is present in the path being looked at. No combination of cache clearing, Pod folder deleting, npm installing, or repo-updating has helped me. These are the only suggestions I have found on solving the error No such file or directory @ rb_sysopen

Thanks in advance!

awaiting input need sample

Most helpful comment

So I updated my appcenter dependencies from v2.4.0 to v2.5.0 and I'm having this issue again 馃檮

Edit: I found a solution without downgrading cocoapods:

  1. Remove appcenter packages (ex: yarn remove appcenter appcenter-crashes. You may not have to remove them all, just appcenter, but I haven't tested that)
  2. cd ios; pod install; cd ..
  3. Add the appcenter packages again (ex: yarn add appcenter appcenter-crashes)
  4. cd ios; pod install; cd ..

Hope this helps somebody...

All 32 comments

You need to upload a sample app with the issue. Check /Users/connormullins/Sonder/ios/Pods/Local Podspecs/appcenter.podspec.json and see if the file is present.

We are unable to diagnose an issue with the given information.

You need to upload a sample app with the issue. Check /Users/connormullins/Sonder/ios/Pods/Local Podspecs/appcenter.podspec.json and see if the file is present.

We are unable to diagnose an issue with the given information.

@dnkoutso If there is no podspec file present in my Local Podspecs directory, do I add one manually? I could copy the file from the appcenter node_module folder.

You shouldn't have to, CocoaPods manages this folder. You can try rm -rf Pods/ and pod install again.

This so far appears to be an RN upgrade issue and not a CocoaPods issue. Unless you can provide an a sample _without_ RN that demonstrates the issue.

@dnkoutso after running rm -rf Pods/ && pod install from my ios folder I receive the same issue. It seems really likely you're correct that this is a ReactNative issue.

Could I clarify how to read the error message with you? Is Errno::ENOENT - No such file or directory @ rb_sysopen - /Users/connormullins/Sonder/ios/Pods/Local Podspecs/appcenter.podspec.json saying that CocoaPods can't find appcenter.podspec.json?

Yes thats what it means. The file should be there but its not. I give it a small chance its a CocoaPods bug or a bug that is exposed into CocoaPods from RN.

If it helps anyone, I was also getting this error.

I upgraded from 1.6.1 to 1.8.3 of CocoaPods as it didn't seem to play nice with the latest version (2.4.0) of the AppCenter bindings for React Native. Originally I was getting the following error: https://github.com/microsoft/appcenter-sdk-react-native/issues/726 馃槱.

I decided I'd downgrade to a version from the 1.7.x branch of CocoaPods after several variations of:

  • Clearing Pods: rm -rf Pods
  • Updating the CocoaPods repo: pod install --repo-update
  • Clearing derived data: rm -rf ~/Library/Developer/Xcode/DerivedData/*
  • Clean build in XCode.

My environment:

  • React Native version: 0.60.5.
  • CocoaPods: 1.7.5.
  • AppCenter: 2.4.0.

Not exactly sure what has changed in CocoaPods between 1.7.x and 1.8.x that could be causing the issue. It's possible that this could be a mixture of React Native 0.61 changes and 1.8.x of CocoaPods.

Downgrading to cocoapods 1.7.5 worked for me. Unfortunately you can't downgrade using homebrew, so I uninstalled the brew version and installed the gem:

  1. brew uninstall cocoapods
  2. sudo gem install cocoapods -v 1.7.5

Edit: Please see my later reply for a better solution that doesn't involve downgrading cocoapods

@sm1th This works but I need cocoapods v >= 1.8.1. Any solutions?

Hi @jarekbb, like @dnkoutso mentioned it's probably an issue with how react native interacts with cocoapods. If you can't downgrade cocoapods, try downgrading react native. Sucky temp solution but until we get updates I'm not sure what else to suggest.

Yes I need clear reproducible steps that prove its a CocoaPods bug and not a ReactNative bug.

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem :+1:

For what it's worth, I reinitialized my project (created a new React Native project, copied all my source to it) and it solved this issue and a few other issues I was having. I know it's annoying to do, but my project had been around since RN v0.58 so there was probably some things I missed when performing updates to newer RN versions.

I'm now using cocoapods 1.8.4 and AppCenter pods just fine with React Native v0.61.2

@sm1th thanks for the insight. I'm a little reluctant to update RN to 0.61 (RN isn't the most stable framework). For anyone in a similar situation to me, my scenario is a clean installation of RN 0.60.5. For now it seems I'll have to stick to 1.7.x of CocoaPods until the time comes to upgrade to RN 0.61.

Same issue here. I updated RN from 0.60.3 to 0.61.2 and then updated CocoaPods to 1.8.4, which caused the missing appcenter.podspec.json file. Downgrading to CocoaPods 1.7.5 fixed the problem.

So I updated my appcenter dependencies from v2.4.0 to v2.5.0 and I'm having this issue again 馃檮

Edit: I found a solution without downgrading cocoapods:

  1. Remove appcenter packages (ex: yarn remove appcenter appcenter-crashes. You may not have to remove them all, just appcenter, but I haven't tested that)
  2. cd ios; pod install; cd ..
  3. Add the appcenter packages again (ex: yarn add appcenter appcenter-crashes)
  4. cd ios; pod install; cd ..

Hope this helps somebody...

@dnkoutso Here's reproducible steps to get this error:

npx react-native init AppcenterTest --template react-native-template-typescript;

cd AppcenterTest;

yarn add -E appcenter appcenter-analytics appcenter-crashes appcenter-auth;

cd ios && pod install && cd ..; # works fine, can repeat command w/o issues

rm -rf ios/Pods/ ios/Podfile.lock;

cd ios && pod install && cd ..; # doesn't work. Works if you delete one of either Pods/ or Podfile.lock, but not both

So I updated my appcenter dependencies from v2.4.0 to v2.5.0 and I'm having this issue again 馃檮

Edit: I found a solution without downgrading cocoapods:

  1. Remove appcenter packages (ex: yarn remove appcenter appcenter-crashes. You may not have to remove them all, just appcenter, but I haven't tested that)
  2. cd ios; pod install; cd ..
  3. Add the appcenter packages again (ex: yarn add appcenter appcenter-crashes)
  4. cd ios; pod install; cd ..

Hope this helps somebody...

Interesting, I noticed this when I did the second pod install

Installing AppCenter 2.5.0
Installing appcenter (2.5.0)

However, it did work for me.

this is a serious issue

one line workaround

npm uninstall appcenter appcenter-crashes -S;cd ios; pod install; cd ..;npm i appcenter appcenter-crashes -S;cd ios; pod install; cd ..;

So I updated my appcenter dependencies from v2.4.0 to v2.5.0 and I'm having this issue again 馃檮

Edit: I found a solution without downgrading cocoapods:

  1. Remove appcenter packages (ex: yarn remove appcenter appcenter-crashes. You may not have to remove them all, just appcenter, but I haven't tested that)
  2. cd ios; pod install; cd ..
  3. Add the appcenter packages again (ex: yarn add appcenter appcenter-crashes)
  4. cd ios; pod install; cd ..

Hope this helps somebody...

I'm dealing with this very issue using the described workaround.
It's a shame we don't have a definitive solution at this point.

Any update on supporting cocoa pods 1.8.3?

We are having the same issue with the following versions:

  • Cocoapods 1.8.4
  • Yarn 1.16.0
  • React Native 0.60.6
  • App Center packages 2.4.0

Upgrading our App Center packages to 2.6.0 did not resolve the issue, but the instructions above from @sm1th did work.

We do not want the extra yarn remove/add steps in our workflow so we're just going to downgrade cocoapods to 1.7.x till we upgrade React Native and/or the issue is resolved another way.

https://github.com/CocoaPods/CocoaPods/issues/9214#issuecomment-548392866 works fine, thanks @sm1th!
I only had to remove/add appcenter.

This issue should not be closed. There is a serious problem that a lot of people are facing.

We need _clear_ reproducible steps on this issue with a project _without_ Flutter or ReactNative in order for us to narrow down the issue in CocoaPods and prove that it is indeed an issue with CocoaPods.

No Yarn, No React Native, No Flutter, nothing.

I will re-open this and we can dig through the issue once a sample is provided.

So I updated my appcenter dependencies from v2.4.0 to v2.5.0 and I'm having this issue again 馃檮

Edit: I found a solution without downgrading cocoapods:

1. Remove appcenter packages (ex: `yarn remove appcenter appcenter-crashes`. You may not have to remove them all, just appcenter, but I haven't tested that)

2. `cd ios; pod install; cd ..`

3. Add the appcenter packages again (ex: `yarn add appcenter appcenter-crashes`)

4. `cd ios; pod install; cd ..`

Hope this helps somebody...

@dnkoutso Becuase this is so easy to reproduce with these steps (but has lots of non CocoaPod stuff in there) it is actually already being investigated (perhaps) by Microsoft here: https://github.com/microsoft/appcenter-sdk-react-native/issues/760

It might be worth monitoring that ticket as well to see if they find that is is a problem their end, agree this is an absolute pain without a plain project to debug for cocoa

Hi,

As I was explaining in the related appcenter issue it seems that having an AppCenter.podspec and an appcenter.podspec in the same project results in this behavior according to my tests.

If confirmed I'm unsure about whether this is an intended behavior in CocoaPods (and consequently, whether it's a CocoaPods issue or an appcenter one).

So I updated my appcenter dependencies from v2.4.0 to v2.5.0 and I'm having this issue again 馃檮

Edit: I found a solution without downgrading cocoapods:

  1. Remove appcenter packages (ex: yarn remove appcenter appcenter-crashes. You may not have to remove them all, just appcenter, but I haven't tested that)
  2. cd ios; pod install; cd ..
  3. Add the appcenter packages again (ex: yarn add appcenter appcenter-crashes)
  4. cd ios; pod install; cd ..

Hope this helps somebody...

this is correct , but just a little hassle free solution is , just comment out appcenter and its dependencies in pod file and do pod install
then uncomment the commented appcenter and it's libraries and do pod install again

this is correct , but just a little hassle free solution is , just comment out appcenter and its dependencies in pod file and do pod install
then uncomment the commented appcenter and it's libraries and do pod install again

As of React Native 0.60, the command use_native_modules! handles including the third party pods into your Podfile.

Therefor you can鈥檛 comment out appcenter.

A yarn remove / yarn add of just appcenter works fine though.

Hey Guys,

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'Native_iOS_App' do
 use_frameworks!

   config = use_native_modules!
   use_react_native!(:path => config["../node_modules/react-native"])

end

this latest pod file helped me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sonu5 picture sonu5  路  3Comments

iosdev-republicofapps picture iosdev-republicofapps  路  3Comments

Mingmingmew picture Mingmingmew  路  3Comments

tlandsmancars picture tlandsmancars  路  3Comments

pronebird picture pronebird  路  3Comments