1

我实际上在 React Native 0.63.3 上,无法使用 Xcode 构建我的项目。命令 pod install 失败并显示以下消息:

CocoaPods could not find compatible versions for pod "FlipperKit/FlipperKitHighlightOverlay":
  In Podfile:
    FlipperKit/FlipperKitHighlightOverlay (~> 0.92.0)

None of your spec sources contain a spec satisfying the dependency: `FlipperKit/FlipperKitHighlightOverlay (~> 0.92.0)`.

这是我的 pod 文件:

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

def add_flipper_pods!(versions = {})
  versions['Flipper'] ||= '~> 0.92.0'
  versions['DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.6.7'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
  versions['Flipper-RSocket'] ||= '~> 1.0'

  pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'

  # List all transitive dependencies for FlipperKit pods
  # to avoid them being linked in Release builds
  pod 'Flipper', versions['Flipper'], :configuration => 'Debug'
  pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'
  pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'
  pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
  pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
  pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
  pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
end

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
end


def find_and_replace(dir, findstr, replacestr)
  Dir[dir].each do |name|
      text = File.read(name)
      replace = text.gsub(findstr,replacestr)
      if text != replace
          puts "Fix: " + name
          File.open(name, "w") { |file| file.puts replace }
          STDOUT.flush
      end
  end
  Dir[dir + '*/'].each(&method(:find_and_replace))
end

target 'XXXX' do
  # Pods for XXXX
  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/callinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true

  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!
  use_native_modules!

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  add_flipper_pods!
  pod 'react-native-webview', :path => '../node_modules/react-native-webview'

  post_install do |installer|
    flipper_post_install(installer)
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end  
    ## Fix for Flipper-Folly on iOS 14.5
  find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
    "atomic_notify_one(state)", "folly::atomic_notify_one(state)")

  find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
    "atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")
    
    ## Fix Deployement Target (have to be > 9)
    installer.pods_project.targets.each do |target|
     target.build_configurations.each do |config|
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
     end
    end
  end
  
end

这是我的 package.json 文件:

{
  "scripts": {
    "postinstall": "node ./scripts/stfu.js",
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "test": "jest --watchAll"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@apollo/client": "^3.3.16",
    "@expo/react-native-action-sheet": "^3.8.0",
    "@expo/vector-icons": "^10.0.0",
    "@react-native-async-storage/async-storage": "^1.13.4",
    "@react-native-community/datetimepicker": "2.4.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-community/netinfo": "^6.0.0",
    "@react-native-community/picker": "1.6.0",
    "@react-native-firebase/app": "^12.3.0",
    "@react-native-firebase/messaging": "12.3.0",
    "@react-navigation/bottom-tabs": "^5.3.1",
    "@react-navigation/native": "^5.7.1",
    "@react-navigation/stack": "^5.7.1",
    "apollo-upload-client": "^14.1.3",
    "axios": "^0.19.2",
    "date-fns": "^2.16.1",
    "deepdash": "^5.3.2",
    "EventEmitter": "^1.0.0",
    "events": "^3.3.0",
    "expo": "^38.0.0",
    "expo-asset": "~8.1.7",
    "expo-blur": "~8.1.2",
    "expo-constants": "~9.1.1",
    "expo-font": "~8.2.1",
    "expo-linear-gradient": "~8.2.1",
    "expo-linking": "^1.0.1",
    "expo-mail-composer": "~8.2.1",
    "expo-notifications": "^0.5.0",
    "expo-splash-screen": "^0.4.0",
    "expo-status-bar": "^1.0.0",
    "expo-updates": "~0.2.10",
    "expo-web-browser": "~8.3.1",
    "formik": "^2.1.5",
    "graphql": "^15.4.0",
    "i18n-js": "^3.7.0",
    "initials": "^3.1.1",
    "lodash": "^4.17.15",
    "mobx": "^5.15.4",
    "mobx-persist": "^0.4.1",
    "mobx-react": "^6.2.2",
    "moment": "^2.26.0",
    "prop-types": "^15.7.2",
    "react": "16.13.1",
    "react-dom": "16.11.0",
    "react-native": "0.63.3",
    "react-native-animatable": "^1.3.3",
    "react-native-calendars": "1.299.0",
    "react-native-currency-input": "^1.0.0",
    "react-native-dialog": "^8.0.1",
    "react-native-dropdownalert": "^4.2.1",
    "react-native-gesture-handler": "^1.7.0",
    "react-native-image-picker": "^3.5.0",
    "react-native-iphone-x-helper": "^1.2.1",
    "react-native-json-tree": "^1.2.1",
    "react-native-localize": "^2.1.1",
    "react-native-markdown-renderer": "^3.2.8",
    "react-native-modalize": "^2.0.5",
    "react-native-paper": "^4.0.1",
    "react-native-parallax-scroll-view": "^0.21.3",
    "react-native-portalize": "^1.0.4",
    "react-native-reanimated": "~1.7.0",
    "react-native-redash": "^14.2.2",
    "react-native-render-html": "^5.1.0",
    "react-native-responsive-screen": "^1.4.1",
    "react-native-safe-area-context": "~3.0.7",
    "react-native-screens": "~2.9.0",
    "react-native-svg": "12.1.0",
    "react-native-unimodules": "~0.10.1",
    "react-native-web": "~0.11.7",
    "react-native-webview": "^11.2.3",
    "sugar": "^2.0.6",
    "xdate": "^0.8.2",
    "yup": "^0.29.2"
  },
  "devDependencies": {
    "@babel/core": "^7.8.6",
    "babel-eslint": "^10.1.0",
    "babel-jest": "~25.2.6",
    "babel-preset-expo": "^8.2.3",
    "eslint": "^7.3.0",
    "eslint-config-airbnb": "^18.2.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-import": "^2.21.2",
    "eslint-plugin-jsx-a11y": "^6.3.1",
    "eslint-plugin-prettier": "^3.1.4",
    "eslint-plugin-react": "^7.20.0",
    "jest": "~25.2.6",
    "jest-expo": "^38.0.0",
    "prettier": "^2.0.5",
    "react-native-clean-project": "^3.4.0",
    "react-test-renderer": "~16.11.0"
  },
  "private": true,
  "name": "dibooq",
  "version": "1.0.0"
}

有没有人遇到过同样的问题,也许找到了解决方案?

4

0 回答 0