CDN: trunk Относительный путь: CocoaPods-version.yml существует

О проблеме также сообщается на Github-Cocoapods.

Итак, я тестировал работу над Jest в своем проекте (использовал RN0.59.10), все было в порядке с установленным и работающим Enzyme. Когда я объединяю их в свой текущий проект (работает на RN0.61), решая некоторые конфликты слияния, я сталкиваюсь с проблемой во время pod install. Что, возможно, пошло не так между ними?

У проекта нет проблем с настройкой снова и снова в RN0.59, проблема возникает только тогда, когда RN0.61 приходит с подфайлом. Следует отметить одну вещь: до интеграции обеих веток мой проект на RN0.61 отлично работает с pod install.

Ниже приведен список методов, которые я пытался решить с проблемой, но, к сожалению, я все еще застрял.

  1. обновление репозитория пода
  2. pod install --repo-update
  3. удалить node_modules + yarn.lock + Pods + Podfile.lock + установить Yarn и снова установить модуль

Лог от pod install --verbose

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
[!] Unable to find a specification for `Firebase/Core (~> 6.9.0)`

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.

Часть моего подфайла (который вызывает у меня проблему):

  # Required by RNFirebase
  pod 'Firebase/Core', '~> 6.9.0'
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
  pod 'Fabric', '~> 1.10.2'
  pod 'Crashlytics', '~> 3.14.0'

Что произойдет, если я удалю 4 строки выше? (Это так неправильно, я сомневаюсь, что что-то пойдет не так с моим местным)

[!] Unable to find a specification for `boost-for-react-native (= 1.63.0)` depended upon by `React-cxxreact`

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.

Версия пода: 1.8.4

React-Native-информация:

System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
    Memory: 65.95 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.10.0 - /usr/local/bin/node
    Yarn: 1.19.0 - /usr/local/bin/yarn
    npm: 6.12.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-24 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom_64
      Android NDK: 19.2.5345600
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5791312
    Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.0 => 0.61.0 
  npmGlobalPackages:
    react-native-cli: 2.0.1

Обновлять:

На самом деле я удалил Podfile.lock во время установки. Когда я возвращаюсь к последнему успешному состоянию (где podfile.lock и yarn.lock находятся в моем каталоге), установка pod проходит успешно!

Я решил углубиться в этот вопрос, вот результат для нескольких сценариев.

Удаление podfile.lock показывает следующее:

[!] Unable to find a specification for `Firebase/Core (~> 6.9.0)`

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.

Удаление yarn.lock показывает следующее:

[!] CocoaPods could not find compatible versions for pod "FBSDKCoreKit":
  In snapshot (Podfile.lock):
    FBSDKCoreKit (= 5.7.0, ~> 5.0, ~> 5.5)

  In Podfile:
    react-native-fbsdk (from `../node_modules/react-native-fbsdk`) was resolved to 1.1.1, which depends on
      react-native-fbsdk/Core (= 1.1.1) was resolved to 1.1.1, which depends on
        FBSDKCoreKit (= 5.8)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `FBSDKCoreKit` inside your development pod `react-native-fbsdk`.
   You should run `pod update FBSDKCoreKit` to apply changes you've made.

Удалив оба yarn.lock + podfile.lock, вы увидите следующее:

[!] Unable to find a specification for `Firebase/Core (~> 6.9.0)`

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.

person TommyLeong    schedule 19.12.2019    source источник
comment
Попробуйте pod install --repo-update   -  person Paul Beusterien    schedule 19.12.2019
comment
@PaulBeusterien Я попробовал упомянутую команду, в результате я получил You have either: * mistyped the name or version. * not added the source repo that hosts the Podspec to your Podfile.   -  person TommyLeong    schedule 20.12.2019
comment
@PaulBeusterien Я обновил пост, указав раздел «Обновление» в качестве заголовка. Я предоставил больше результатов там.   -  person TommyLeong    schedule 20.12.2019


Ответы (1)


TLDR;

Добавить source 'https://cdn.cocoapods.org/' к подфайлу (перед тем, как сделать target 'projectName')


Наконец-то причина найдена и решение найдено! Причина в том, что у меня есть privateRepo в моем podfile, который перезаписывает источник по умолчанию для получения podspecs от Cocoapods. Пример ошибки, как показано ниже

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
source 'https://github.com/privateRepo/Specs.git'

target 'project' do
  # Comment the next line if you don't want to use dynamic frameworks
  # use_frameworks!
.....
....
...
..
.
end

Следовательно, простое решение, указывающее на CDN Cocoapods, решит проблему.

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
source 'https://github.com/privateRepo/Specs.git'

target 'project' do
  # Comment the next line if you don't want to use dynamic frameworks
  # use_frameworks!
.....
....
...
..
.
end
person TommyLeong    schedule 24.12.2019
comment
два фрагмента идентичны, во втором вы не применили исправление - person Heps; 03.02.2021