当工作空间中有多个xcode项目时,如何将cocoapods cordova插件src链接到.framework头文件?

编程入门 行业动态 更新时间:2024-10-26 19:30:13
本文介绍了当工作空间中有多个xcode项目时,如何将cocoapods cordova插件src链接到.framework头文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

独特的情况是,这是一个Ionic应用程序,可通过Pod提取未编译的插件源.问题在于,编译时,插件头和实现无法找到.framework的头/实现.演示版Cordova应用程序找到了.framework,但它们只是在一个项目中.

The unique situation is that this is an Ionic app that pulls in the uncompiled plugin source via pods. The problem is that when compiling, the plugin headers and implementation can't find the .framework's headers/implementation. The demo Cordova app finds the .framework, but they're only in a single project.

我尝试了所有找不到头文件"的建议.

I've tried all the suggestions for "header file not found".

  • 将.framework添加到pod项目或app项目的链接库中
  • 为每个目标,每个应用(及其组合)添加搜索路径
  • 添加链接的二进制文件
  • 添加标题/源以构建阶段
  • 将s.vendored_frameworks = 'ValidicMobile.framework添加到podspec并执行pod update
  • Adding the .framework to the linked libraries of either the pods project or the app project
  • Adding search paths to every target, every app (and combinations thereof)
  • Adding a linked binary
  • Adding headers/sources to build phases
  • add s.vendored_frameworks = 'ValidicMobile.framework to the podspec and doing pod update

接下来要尝试的是什么?假设pod可以更好地进行链接,将供应商.framework封装在cocoapod中是否可以帮助插件找到框架?该插件需要在Pod中导入其他Cordova框架,因此不确定我是否可以将src直接放在主应用程序中.

What might be the next thing to try? Would wrapping the vendor .framework in a cocoapod help the plugin find the framework, assuming pods would be better at linking? The plugin requires the import of the other Cordova frameworks in the pods, so not sure if I can put the src directly in the main app or not.

推荐答案

我不确定它是否适用于您的方案,但是回想一下,我确实为podfile中的其中一个Pod发布了PCH文件的处理.

I'm not sure if it's applicable for your scenario, but way back I did post processing of the PCH file for one of my pods in the podfile.

platform :ios, '7.0' pod 'A','7.4.1' pod 'B', '0.3.1-beta2' pod 'C', '0.6.5' post_install do | installer | print "Updating #{installer.sandbox.target_support_files_root}/Pods-A/A.pch\n" open("#{installer.sandbox.target_support_files_root}/Pods-A/A.pch","a") do |file| file.puts <<EOF //your extra stuff goes here #import "../../../A/Hacks/someExtraHeader1.h" #import "../../../A/Hacks/someExtraHeader2.h" EOF end end

这使我能够在pod install期间将所有Pod的所有源都检出之后,在pod级别上注入额外的标题导入.

That allowed me to inject extra header imports on pod level during pod install after all the sources of the pods have already been checked out.

更多推荐

当工作空间中有多个xcode项目时,如何将cocoapods cordova插件src链接到.framework头文件?

本文发布于:2023-11-23 05:12:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620209.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   中有   如何将   插件   头文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!