当前位置: 首页 > ai >正文

xcode swift项目运行、连接真机运行报错,引入文件夹失败

最近乱七八糟解决了很多报错,看着记录点吧

xcode版本:16

  1. failed to emit precompiled header ‘/Users/yuqing/Library/Developer/Xcode/DerivedData/cloudspace-ios-ejldldcfhouqnretchuzoewmsqkg/Build/Intermediates.noindex/PrecompiledHeaders/spice-bridging-swift_3NESF7AR5B9EZ-clang_2VK5NNZMD2JQ0.pch’ for bridging header ‘/Users/yuqing/Desktop/cloudspace-ios/cloudspace-ios/spice-bridging.h’

解决方法:
在这里插入图片描述

  1. 连接真机运行报错
    dyld[34390]: Library not loaded: @rpath/libpixman-1.0.dylib
    Referenced from: <27C19E31-3CAC-3029-91AF-D563F06A2CF7> /private/var/containers/Bundle/Application/101FCD29-5874-4D03-9BB5-EA4FA22C2793/cloudspace-ios.app/cloudspace-ios.debug.dylib
    Reason: tried: ‘/usr/lib/system/introspection/libpixman-1.0.dylib’ (no such file, not in dyld cache), ‘/private/var/containers/Bundle/Application/101FCD29-5874-4D03-9BB5-EA4FA22C2793/Frameworks/libpixman-1.0.dylib’ (no such file), ‘/private/var/containers/Bundle/Application/101FCD29-5874-4D03-9BB5-EA4FA22C2793/cloudspace-ios.app/libpixman-1.0.dylib’ (no such file), ‘/private/var/containers/Bundle/Application/101FCD29-5874-4D03-9BB5-EA4FA22C2793/Frameworks/libpixman-1.0.dylib’ (no such file), ‘/private/var/containers/Bundle/Application/101FCD29-5874-4D03-9BB5-EA4FA22C2793/cloudspace-ios.app/libpixman-1.0.dylib’ (no such file), ‘/private/var/containers/Bundle/Application/101FCD29-5874-4D03-9BB5-EA4FA22C2793/Frameworks/libpixman-1.0.dylib’ (no such file)
    在这里插入图片描述

解决方法:
修改runpath search paths
@executable_path/Frameworks
$(inherited)
在这里插入图片描述

  1. xcode中引入文件夹下的html,报错找不到文件

解决办法:
在这里插入图片描述


4. 我引入的html是一个uniapp打包出的h5,嵌入项目后可以正常展示,但uni.navigateback({delta:1})方法失败,返回无效 原代码:
    func loadLocalHTML() {if let filePath = Bundle.main.path(forResource: "index", ofType: "html", inDirectory: "h5") {do {NSLog("---------开始h5---------")let htmlString = try String(contentsOfFile: filePath, encoding: .utf8)let baseURL = Bundle.main.url(forResource: "h5", withExtension: nil)webView!.loadHTMLString(htmlString, baseURL: baseURL)} catch {print("读取文件失败: \(error)")}} else {print("未找到h5/index.html 文件")}}

解决方法:

    func loadLocalHTML() {guard let htmlFolderPath = Bundle.main.path(forResource: "h5", ofType: nil) else {print("not file")return}let htmlFilePath = (htmlFolderPath as NSString).appendingPathComponent("index.html")let fileManager = FileManager.defaultif !fileManager.fileExists(atPath: htmlFilePath) {print("Error: 'index.html' not found at path: \(htmlFilePath)")return}let fileURL = URL(fileURLWithPath: htmlFilePath)webView.loadFileURL(fileURL, allowingReadAccessTo: fileURL.deletingLastPathComponent())}
http://www.xdnf.cn/news/16728.html

相关文章:

  • 伞状Meta分析重构癌症幸存者照护指南:从矛盾证据到精准决策
  • 法国彩虹重磅发布EmVue:解锁能源监控新方式
  • 电商一键上货软件推荐:实在Agent、面兜兜、京老虎、妙手、青虎
  • 如何快速给PDF加书签--保姆级教程
  • Elasticsearch IK 中文分词器指南:从安装、配置到自定义词典
  • Java 22 新特性解析与代码示例
  • C++ 构造函数语义学
  • c++详解(宏与内联函数,nullptr)
  • MongoDB 详细用法与 Java 集成完整指南
  • Java应用服务器选型指南:WebLogic vs. Tomcat、WebSphere、JBoss/Wildfly
  • C++ 前缀和、双指针
  • Linux 硬盘分区管理
  • 代理IP并发控制:多线程爬虫的加速引擎
  • CSS的2D转换
  • 用 Ubuntu 22.04 (Jammy) 的 MongoDB 源
  • SpringBoot AI应用实战:从图像识别到预测分析
  • EasyExcel 格式设置大全
  • 3ds Max V-Ray渲染崩溃?8招告别卡顿冻结
  • [2025CVPR-图象生成方向]ODA-GAN:由弱监督学习辅助的正交解耦比对GAN 虚拟免疫组织化学染色
  • Blender 4.5 安装指南:快速配置中文版,适用于Win/mac/Linux系统
  • Git 实现原理剖析
  • Eigent:革新复杂任务处理的多智能体协作平台技术解析
  • 使用 Vive Tracker 替代 T265 实现位姿获取(基于 Ubuntu + SteamVR)
  • Next.js 中使用 MongoDB 完整指南
  • C# 引用外部项目
  • MyBatis详解
  • forceStop流程会把对应进程的pendingIntent给cancel掉
  • FreeSWITCH与Java交互实战:从EslEvent解析到Spring Boot生态整合的全指南
  • ABP VNext + Dapr Workflows:轻量级分布式工作流
  • 基于 USBD 库 CDC Standalone 例程中的一个 Bug 解析