Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No podspec found for `FBReactNativeSpec` in `../node_modules/react-native/Libraries/FBReactNativeSpec`

I have upgrade react-native to 0.64 and I'm getting this error after I run pod install.

No podspec found for `FBReactNativeSpec` in `../node_modules/react-native/Libraries/FBReactNativeSpec`

I have tried to remove the node_module, remove the pod file, deintegrate, but still got this issue.

Any help?

like image 978
Paolo Avatar asked Mar 25 '21 12:03

Paolo


2 Answers

The newer version of ReactNative (starting from 0.64) store FBReactNativeSpec in another folder. You will need to replace the legacy FBReactNativeSpec path with the new one in the Pod declaration.

Open your Podfile and find this line :

pod 'FBReactNativeSpec', :path => "./node_modules/react-native/Libraries/FBReactNativeSpec"

And fix the path by replacing with this one :

pod 'FBReactNativeSpec', :path => "../node_modules/react-native/React/FBReactNativeSpec"
like image 179
Albrecht Andrzejewski Avatar answered Sep 19 '22 04:09

Albrecht Andrzejewski


While I am updating to the new react-native version 0.64.1,then I got the above-mentioned error when I tried pod install.I have fixed the issue by replacing the content on my podfile like the following

https://raw.githubusercontent.com/react-native-community/rn-diff-purge/release/0.64.1/RnDiffApp/ios/Podfile

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

platform :ios, '10.0'

target 'RnDiffApp' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  target 'RnDiffAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
  end
end

I changed my podfile like the above.Then I tried pod install on my terminal.Its working fine.

like image 24
IKKA Avatar answered Sep 20 '22 04:09

IKKA