Home > OS >  The project ‘Pods’ is damaged and cannot be opened. Examine the project file for invalid edits or un
The project ‘Pods’ is damaged and cannot be opened. Examine the project file for invalid edits or un

Time:05-18

My "pods" after pod install are not recognised by Xcode and cause my build to failed.

This is the message I have while trying to opening pods from Pods/Pods.xcodeproj:

The project ‘Pods’ is damaged and cannot be opened. Examine the project file for invalid edits or unresolved source control conflicts.

This is my podfile:

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

# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false


target 'applicationTemplate' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!
  # Pods for applicationTemplate
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])
  pod 'RNFBAnalytics', :path => '../node_modules/@react-native-firebase/analytics'
  pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
  pod 'react-native-webview', :path => '../node_modules/react-native-webview'
  pod 'react-native-voice', :path => '../node_modules/react-native-voice'
  pod 'react-native-torch', :path => '../node_modules/react-native-torch'
  pod 'RNKeychain', :path => '../node_modules/react-native-keychain'
  
  pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'

  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'

  pod 'RNOpenAppSettings', :path => '../node_modules/react-native-app-settings'

  target 'applicationTemplateTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'applicationTemplate-tvOS' do
  # Pods for applicationTemplate-tvOS

  target 'applicationTemplate-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

# App Tracking Transparency https://rnfirebase.io/analytics/usage#disable-ad-id-usage-on-ios
$RNFirebaseAnalyticsWithoutAdIdSupport = true

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'react-native-config'
      phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
      phase.shell_script = "cd ../../"\
      " && RNC_ROOT=./node_modules/react-native-config/"\
      " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
      " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"
      
      target.build_phases << phase
      target.build_phases.move(phase,0)
    end
  end
  react_native_post_install(installer)
  __apply_Xcode_12_5_M1_post_install_workaround(installer)
 end

CodePudding user response:

This is how I solved the issue:

Just removing this line: install! 'cocoapods', :deterministic_uuids => false and run pod deintegrate && pod cache clean --all && pod install

I added it because I was using react-native upgrade helper and I saw that in their podfile their was this line so I added it but apparently it does not work for every upgrade so be careful with upgrade helper.

  • Related