我正在开发一个在 Xcode (16.1) 中使用 Capacitor 和 CocoaPods 的项目,在构建时收到几条错误消息,包括:“找不到 Capacitor/Capacitor-Swift.h 文件”“无法为未定义的类定义类别” “CAPPluginCall”“找不到”CAPPluginCall”的接口声明“选择器没有已知的类方法“jsDateFormatter”此外,还有一个警告:运行脚本构建阶段“[CP] Embed Pods Frameworks”在每个构建上执行,因为它没有指定任何输出。
我已经采取了以下步骤来解决问题:使用 pod install 重新安装 CocoaPods。在构建设置中,确保定义模块设置为“是”,不幸的是错误仍然存在。是否有任何我可能忽略的特定设置或步骤来正确包含 Capacitor-Swift.h 文件并修复其他错误?
详情: Xcode 版本:16.1 电容版本:6.1.2 CocoaPods-版本:1.15.2
依赖关系:
{
"name": "MYAPP",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"test.e2e": "cypress run",
"test.unit": "vitest",
"lint": "eslint"
},
"dependencies": {
"@capacitor/app": "6.0.1",
"@capacitor/core": "6.1.2",
"@capacitor/haptics": "6.0.1",
"@capacitor/ios": "6.1.2",
"@capacitor/keyboard": "6.0.2",
"@capacitor/status-bar": "6.0.1",
"@ionic/react": "^8.0.0",
"@ionic/react-router": "^8.0.0",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"ionicons": "^7.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4"
},
"devDependencies": {
"@capacitor/cli": "6.1.2",
"@testing-library/dom": ">=7.21.4",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-legacy": "^5.0.0",
"@vitejs/plugin-react": "^4.0.1",
"cypress": "^13.5.0",
"eslint": "^8.35.0",
"eslint-plugin-react": "^7.32.2",
"jsdom": "^22.1.0",
"terser": "^5.4.0",
"typescript": "^5.1.6",
"vite": "~5.2.0",
"vitest": "^0.34.6"
},
"description": "An Ionic project"
}
任何解决这些问题的帮助或想法将不胜感激!
我也有同样的错误。你有什么解决办法吗?