pod install 后我的“pod”無法被 Xcode 識別并導致我的構建失敗。
這是我在嘗試從Pods/Pods.xcodeproj打開 pod 時收到的訊息:
專案“Pods”已損壞,無法打開。檢查專案檔案是否存在無效編輯或未解決的源代碼管理沖突。
這是我的播客檔案:
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
uj5u.com熱心網友回復:
這就是我解決問題的方法:
只需洗掉此行:install! 'cocoapods', :deterministic_uuids => false并運行pod deintegrate && pod cache clean --all && pod install
我添加它是因為我使用的是 react-native 升級助手,我在他們的 podfile 中看到了這一行,所以我添加了它,但顯然它不適用于每次升級,所以要小心升級助手。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/476701.html
標籤:代码
上一篇:Xcode損壞,拒絕運行代碼
