facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.21k stars 24.33k forks source link

CocoaPods could not find compatible versions for pod "React/Core" upgrading to 0.60.0 #25553

Closed nporter-adbe closed 5 years ago

nporter-adbe commented 5 years ago

React Native version: ^0.60.0

Steps To Reproduce

  1. Create a Podfile similar to this:
    
    platform :ios, '10.0'

target 'MyTarget' do

inherit! :search_paths

Pods for testing

react_native_path = "../node_modules/react-native" pod 'React', :path => "#{react_native_path}", :subspecs => [ 'Core', 'CxxBridge', 'DevSupport', 'RCTText', 'RCTNetwork', 'RCTImage', 'RCTWebSocket', ]

pod "yoga", :path => "#{react_native_path}/ReactCommon/yoga" pod 'Folly', :podspec => "#{react_native_path}/third-party-podspecs/Folly.podspec" end

2. `npm install`
3. ` cd ios && pod install`

<!--
 Issues without reproduction steps or code are likely to stall.
-->

In version 0.59 this worked as expected and the pod install did not fail.

Error message from Cocoapods:

[!] CocoaPods could not find compatible versions for pod "React/Core": In Podfile: React/Core (from ../node_modules/react-native)

None of your spec sources contain a spec satisfying the dependency: React/Core (from../node_modules/react-native).

You have either:

Note: as of CocoaPods 1.0, pod repo update does not happen on pod install by default.



<!--
  Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or
  provide a minimal code example that reproduces the problem.
  Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve.
-->
danilobuerger commented 5 years ago

Podfile is wrong. See https://github.com/facebook/react-native/blob/v0.60.0/template/ios/Podfile

tianjyan commented 5 years ago

Not only we should change project's Podfile, but also the third party deps also should update their repos. The .podspec file that contains s.dependency 'React/Core' should change to s.dependency 'React-Core.

uc-apa commented 5 years ago

I am also facing the same issue.

image

jaswantjatav commented 5 years ago

Hi, I am also stocked on this error. Screenshot 2019-07-10 at 10 07 46 AM

jaswantjatav commented 5 years ago

Hey , @tianjyan Thanks it is fixed by this . Not only we should change project's Podfile, but also the third party deps also should update their repos. The .podspec file that contains s.dependency 'React/Core' should change to s.dependency 'React-Core.

AliEbrahimpour commented 5 years ago

not work !

Screen Shot 2019-07-11 at 2 10 02 PM

jaswantjatav commented 5 years ago

Please update this line into node_modules/react-native-keepcall/RNCallKeep.podspec

Screenshot 2019-07-11 at 4 12 27 PM

vivekhumnabad commented 5 years ago

Hi,

Till now I am not using React-RCTVibration. but with the latest upgrade, it is asking me to install as react has its dependency.

Not only this lib other libs like React-RCTNetwork, React_RCTSettings I was not using, but it is forcing me to install because of latest upgrade, Is there any way we can ignore libs we are not using and use only which is needed.

Please let me know, this will reduce a lot of compile time. Thanks

FYI I am using cocoa pods and my project is a hybrid project

vauruk commented 5 years ago

I have the same problem, Captura de Tela 2019-07-11 às 11 00 43

woodpav commented 5 years ago

Same issue. react: ^16.8.6 and react-native: 0.60.2 I do not have use_frameworks.

pod 'React', path: rn_path, subspecs: [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
]

I am getting this error:

[!] CocoaPods could not find compatible versions for pod "React/RCTVibration":
  In Podfile:
    React/RCTVibration (from `../node_modules/react-native`)
PavanKumar-sa commented 5 years ago

Facing same issue while migrating to 0.60: when we try 'pod install', below given error appears:

[!] CocoaPods could not find compatible versions for pod "React/Core":
  In Podfile:
    RNSound (from `../node_modules/react-native-sound`) was resolved to 0.10.12, which depends on
      React/Core

None of your spec sources contain a spec satisfying the dependency: `React/Core`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.
steven-taglohner commented 5 years ago

after creating a new project with version 0.60 I see the Podfile changes

`platform :ios, '9.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'test' do

Pods for test

pod 'React', :path => '../node_modules/react-native/' pod 'React-Core', :path => '../node_modules/react-native/React' pod 'React-DevSupport', :path => '../node_modules/react-native/React' pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook' 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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

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 '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'

target 'testTests' do inherit! :search_paths

Pods for testing

end

use_native_modules! end

target 'test-tvOS' do

Pods for test-tvOS

target 'test-tvOSTests' do inherit! :search_paths

Pods for testing

end

end `

kelset commented 5 years ago

👋 everyone.

Has we mentioned in the blogpost, the Pods dependency has changed -> https://github.com/facebook/react-native/commit/2321b3f

You need to change your Pod configuration to match the new format.

hieuuet commented 5 years ago

Hi, I am also stocked on this error. Screenshot 2019-07-10 at 10 07 46 AM

same issue. :(. How to fix

shabeer3508 commented 5 years ago

Not only we should change project's Podfile, but also the third party deps also should update their repos. The .podspec file that contains s.dependency 'React/Core' should change to s.dependency 'React-Core.

it worked, you saved my day.

ollyde commented 5 years ago

This is garbage. No wonder people are leaving React Native in droves.

sudomann commented 5 years ago

@tianjyan I actually did a file search for the 'React/Core' in my entire project folder (node_modules included). 0 matches. That just does not exist anywhere in my code.

I have the exact same error output the person who started this issue got and this part confuses me:

[!] CocoaPods could not find compatible versions for pod "React/Core":
  In Podfile:
    React/Core (from `../node_modules/react-native/`)

None of your spec sources contain a spec satisfying the dependency: `React/Core (from `../node_modules/react-native/`)`.

This is my first time editing this part of the code, and I may have interpreted it wrongly. I understood it to mean: _"CocoaPods looked for and could not find a pod named 'React/Core'. This pod is a dependency that was specified in the package at ../node_modules/react-native/"_.

Can anyone weigh in as to whether I'm correct in thinking this?

I already did a search of file contents for my entire project directory and did not get a hit for any place React-Core may be badly defined as React/Core. Any way to make that output be more helpful in pointing out where I should look?

tianjyan commented 5 years ago

@sudomann Do you remove node_modules and reinstall the packages after you update your package.json ?

sudomann commented 5 years ago

@tianjyan Nope, I didn't do that. I doubt it would change anything if I did that.

See this answer on my stack overflow post. I haven't had time to try out his suggestion yet, but if you're facing the same issue as me, go ahead and see if it solves the issue.

asleepace commented 5 years ago

Here is a little workaround I'm using right now, run this bash command in the root directory of the project which replaces React/Core with React-Core in all the npm modules

grep -rl "s.dependency 'React/Core'" node_modules/ | xargs sed -i '' 's=React/Core=React-Core=g'
kirhim commented 5 years ago

where is the .podspec file?

greentornado commented 5 years ago

Podfile is wrong. See https://github.com/facebook/react-native/blob/v0.60.0/template/ios/Podfile

this solved

predbjorn commented 5 years ago

I had the same problem after upgrading react (and the podfile). What did it for me was deleting podfile.lock

shibathethinker commented 5 years ago

@predbjorn 's suggestion worked for me. Thank you

bethwelt commented 5 years ago

@Asleepace workaround worked for me.

jiffy-arti commented 5 years ago

Nothing worked for regarding this issue. I did run following command

grep -rl "s.dependency 'React/Core'" node_modules/ | xargs sed -i '' 's=React/Core=React-Core=g'

But when I ran pod install I got following errors

Installing glog (0.3.5) [!] /bin/bash -c set -e

!/bin/bash

Copyright (c) Facebook, Inc. and its affiliates.

#

This source code is licensed under the MIT license found in the

LICENSE file in the root directory of this source tree.

set -e

PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}" CURRENT_ARCH="${CURRENT_ARCH}"

if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then

Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.

# it's better to rely on platform name as fallback because architecture differs between simulator and device

if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then
    CURRENT_ARCH="x86_64"
else
    CURRENT_ARCH="armv7"
fi

fi

export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)" export CXX="$CC"

Remove automake symlink if it exists

if [ -h "test-driver" ]; then rm test-driver fi

./configure --host arm-apple-darwin

Fix build for tvOS

cat << EOF >> src/config.h

/ Add in so we have Apple Target Conditionals /

ifdef APPLE

include

include

endif

/ Special configuration for AppleTVOS /

if TARGET_OS_TV

undef HAVE_SYSCALL_H

undef HAVE_SYS_SYSCALL_H

undef OS_MACOSX

endif

/ Special configuration for ucontext /

undef HAVE_UCONTEXT_H

undef PC_FROM_UCONTEXT

if defined(__x86_64__)

define PC_FROM_UCONTEXT uc_mcontext->ss.rip

elif defined(i386)

define PC_FROM_UCONTEXT uc_mcontext->ss.eip

endif

EOF

Prepare exported header include

EXPORTED_INCLUDE_DIR="exported/glog" mkdir -p exported/glog cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/" cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/" cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/" cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/" cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"

checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-apple-darwin-strip... no checking for strip... strip checking for a thread-safe mkdir -p... ./install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot checking whether the C compiler works... no xcrun: error: SDK "iphoneos" cannot be located xcrun: error: SDK "iphoneos" cannot be located xcrun: error: SDK "iphoneos" cannot be located xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos' /Users/arti/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da/missing: Unknown --is-lightweight' option Try/Users/arti/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da/missing --help' for more information configure: WARNING: 'missing' script is too old or missing configure: error: in /Users/arti/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-1f3da': configure: error: C compiler cannot create executables Seeconfig.log' for more details

basha777 commented 5 years ago

I have the same problem, Captura de Tela 2019-07-11 às 11 00 43

if you are getting this error the you need to in latest version of react-native-image-crop-picker try installing npm i react-native-image-crop-picker@0.25.0 --save and cd ios and
pod install

landscape-fire commented 4 years ago

Question: Unable to find a specification for 'React-RCTActionSheet(= 0.61.5)' depend upon by React did any one happened?

bogdanbolchis commented 4 years ago

Not only we should change project's Podfile, but also the third party deps also should update their repos. The .podspec file that contains s.dependency 'React/Core' should change to s.dependency 'React-Core.

Some 3rd party modules have already updated their podspecs. What worked for me was upgrading the 3rd party module itself (in package.json). In my case that was rn-fetch-blob.

MayoudP commented 4 years ago

Actually got the same but with intercom, can't figured out what's wrong or just how to fixed it ?


  In Podfile:
    react-native-intercom (from `../node_modules/react-native-intercom`) was resolved to 13.0.0, which depends on React/Core```
Pointotech commented 4 years ago

With the Podfile template linked above, you get this error:

$ pod install
Analyzing dependencies
[!] No podspec found for `React-Core` in `../node_modules/react-native/React`

Which makes perfect sense, because the only .podspec file in that directory is React-RCTFabric.podspec.

The linked Podfile doesn't work. No other solution in this thread. Why is this ticket closed with no solution to a widespread problem, which should be covered in the official documentation?

Pointotech commented 4 years ago

This is garbage. No wonder people are leaving React Native in droves.

Yeah, the project seems unmaintained. Tons of critical bugs like this, where no one gives an answer and it somehow gets closed. So many undocumented, but critical steps to making a React-Native module.

As much as I appreciate using JSX instead of Apple's terrible Xcode UI-builder-UI, it's just not worth it when it means I have to use a tool that's arguably even more unmaintained than Apple's.

AhmadSadiq0 commented 4 years ago

Try this out, it worked like a charm In Root Directory run this command grep -rl "s.dependency 'React/Core'" node_modules/ | xargs sed -i '' 's=React/Core=React-Core=g'

Source: https://stackoverflow.com/questions/58305191/react-native-fetch-blob-issue-pod-not-installing-for-ios

Aman-Aalam commented 4 years ago

👋 everyone.

Has we mentioned in the blogpost, the Pods dependency has changed -> 2321b3f

You need to change your Pod configuration to match the new format.

Please also point us to any documentation on how to do that. Please don't assume that devs in React-Native realm already know iOS nuances :-|

costerik commented 4 years ago

same here $ npx react-native init App --template react-native-template-typescript


               ######                ######
             ###     ####        ####     ###
            ##          ###    ###          ##
            ##             ####             ##
            ##             ####             ##
            ##           ##    ##           ##
            ##         ###      ###         ##
             ##  ########################  ##
          ######    ###            ###    ######
      ###     ##    ##              ##    ##     ###
   ###         ## ###      ####      ### ##         ###
  ##           ####      ########      ####           ##
 ##             ###     ##########     ###             ##
  ##           ####      ########      ####           ##
   ###         ## ###      ####      ### ##         ###
      ###     ##    ##              ##    ##     ###
          ######    ###            ###    ######
             ##  ########################  ##
            ##         ###      ###         ##
            ##           ##    ##           ##
            ##             ####             ##
            ##             ####             ##
            ##          ###    ###          ##
             ###     ####        ####     ###
               ######                ######

                  Welcome to React Native!
                 Learn once, write anywhere

✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing CocoaPods dependencies (this may take a few minutes)
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./App/ios && pod install".
CocoaPods documentation: https://cocoapods.org/

How should I proceed?

NickMandylas commented 4 years ago

For those updating from an older react-native version (i.e. 0.62.xx to 0.63.xx), running pod update will fix the issue, pod install does not work.

usama-homage commented 4 years ago

After following the complete thread nothing works :). Here is the final solution which works like charm for me.

http://themasterworld.com/cocoapods-could-not-find-compatible-versions-for-pod-react-core-upgrading-to-0-63-x

ahsanmster commented 4 years ago

Podfile is wrong. See https://github.com/facebook/react-native/blob/v0.60.0/template/ios/Podfile

No podspec found forReact-Corein../node_modules/react-native/React``

TRIPTI-JAIN commented 3 years ago

If You getting any error Follow the process of React Native to upgrade version from this link https://react-native-community.github.io/upgrade-helper/

95Rawan commented 3 years ago

I just ran this command that it gave me: pod update Folly --no-repo-update and I don't get the error anymore.

kevinjoel commented 3 years ago

Try this out, it worked like a charm In Root Directory run this command grep -rl "s.dependency 'React/Core'" node_modules/ | xargs sed -i '' 's=React/Core=React-Core=g'

Source: https://stackoverflow.com/questions/58305191/react-native-fetch-blob-issue-pod-not-installing-for-ios

thanks this work for me!

eufernandodias commented 3 years ago

For those updating from an older react-native version (i.e. 0.62.xx to 0.63.xx), running pod update will fix the issue, pod install does not work.

Works for me.

tundsD53 commented 3 years ago

I'm trying to get this working with Xcode 12.4, and i'm coming across the same issue also with cocoapods.

This is our current package.json

{
  "name": "xxxxxx",
  "version": "1.8",
  "private": true,
  "scripts": {
    "start": "yarn react-native start"
  },
  "dependencies": {
    "react": "16.13.1",
    "react-native": "^0.63.4"
  }
}

Here is out current PodFile

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

def react_components
  # Your 'node_modules' directory is probably in the root of your project,
  # but if not, adjust the `:path` accordingly
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge', # Include this for RN >= 0.47
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket' # needed for debugging
    # Add any other subspecs you want to use in your project
  ]
  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"

  # Third party deps podspec link
  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'
end

def project_pods

  pod 'Moya'
  pod 'Firebase/Analytics'
  pod 'Firebase/Messaging'
  pod 'Firebase/Crashlytics'
  pod 'Firebase/RemoteConfig'
  pod 'SwiftKeychainWrapper'
end

def internal_pods

end

target 'xxxx UAT' do
  inherit! :search_paths
  project_pods
  internal_pods
  react_components
end

target 'xxxx Release' do
  inherit! :search_paths
  project_pods
  internal_pods
  react_components
end

target 'xxxx Dev' do
  inherit! :search_paths
  project_pods
  internal_pods
  react_components
end

Whenever I run pod install or pod update in the terminal. I seem to be getting the following error.

pod install --repo-update
Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1
Ignoring bigdecimal-2.0.0 because its extensions are not built. Try: gem pristine bigdecimal --version 2.0.0
Ignoring redcarpet-3.5.0 because its extensions are not built. Try: gem pristine redcarpet --version 3.5.0
Ignoring sassc-2.4.0 because its extensions are not built. Try: gem pristine sassc --version 2.4.0
Updating local specs repositories
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "React/RCTNetwork":
  In Podfile:
    React/RCTNetwork (from `../node_modules/react-native`)

None of your spec sources contain a spec satisfying the dependency: `React/RCTNetwork (from `../node_modules/react-native`)`.

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

I've gone into the node modules folder, and I can't see anything referring to this podspec, so when I install the node modules this podspec is missing. I've tried the following so far.

I've unfortunately run out of ideas here and I really need help to get this resolved.

Haseeba393 commented 3 years ago

@jaswantjatav Thanks it solved issuse