[英]How to link a cocoapods cordova plugin src to a .framework header file when there's multiple xcode projects in the workspace?
The unique situation is that this is an Ionic app that pulls in the uncompiled plugin source via pods. 独特的情况是,这是一个Ionic应用程序,通过pod提取未编译的插件源。 The problem is that when compiling, the plugin headers and implementation can't find the .framework's headers/implementation. 问题是,在编译时,插件头和实现无法找到.framework的头文件/实现。 The demo Cordova app finds the .framework, but they're only in a single project. 演示Cordova应用程序找到.framework,但它们只在一个项目中。
I've tried all the suggestions for "header file not found". 我已经尝试了“未找到头文件”的所有建议。
s.vendored_frameworks = 'ValidicMobile.framework
to the podspec and doing pod update
将s.vendored_frameworks = 'ValidicMobile.framework
添加到podspec并执行pod update
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? 将供应商.framework包装在cocoapod中可以帮助插件找到框架,假设pod更适合链接吗? 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. 该插件需要在pod中导入其他Cordova框架,因此不确定我是否可以将src直接放在主应用程序中。
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
. 我不确定它是否适用于您的场景,但回过头来我在podfile
为我的一个pod发布了PCH文件的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
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. 这允许我在已经检出pod install
所有源之后,在pod install
期间在pod级别上注入额外的头部导入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.