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

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.lryc.cn/news/607522.html

相关文章:

  • [2025CVPR-图象生成方向]ODA-GAN:由弱监督学习辅助的正交解耦比对GAN 虚拟免疫组织化学染色
  • python PIL图片转base64字符串
  • 练习javaweb+mysql+jsp
  • 告别“AI味”图像!最新开源AI模型FLUX.1-Krea实现真实光影生成
  • [CISCN 2022 初赛]online_crt
  • 【PHP 自动加载机制详解】
  • 四、基于SpringBoot,MVC后端开发笔记
  • Qwen2 RotaryEmbedding 位置编码仅仅是第一层有吗
  • 提问总结2
  • Eden 和 Survivor 比例可以调整么,参数是什么?还用到了哪些参数?
  • SpringCloud(一)微服务基础认识
  • U-Net vs. 传统CNN:为什么医学图像分割需要跳过连接?
  • 04 基于sklearn的机械学习-梯度下降(上)
  • Linux内核构建系统中的auto.conf与autoconf.h:原理与作用解析
  • ARM Cortex-M 处理器的应用
  • NDI开发指南
  • LeetCode 热题100:206. 反转链表
  • 深入讲讲异步FIFO
  • 向华为学习——IPD流程体系之IPD术语
  • Java函数式编程之【Stream终止操作】【下】【三】【收集操作collect()与分组分区】【下游收集器】
  • 从零开始:Python编程快速入门指南
  • 实战指南:如何将Git仓库中的特定文件夹及其历史完整迁移到另一个仓库
  • vue+element 实现下拉框共享options
  • 智能客服系统实战:多轮对话与知识库检索完整实现
  • 《n8n基础教学》第三节:模拟一个自动化场景
  • Android使用MediaProjectionManager获取游戏画面和投屏
  • C语言-字符串(定义)、字符串函数(strlen、strcat、strcpy、strcmp、strlwr、strupr)
  • 【string类常见接口】
  • Linux系统编程Day3-- Linux常用操作(续)
  • 基于深度学习的医学图像分析:使用Autoencoder实现医学图像去噪