如何使用插件复制自定义的ios框架。xml Phonegap 3

时间:2023-01-20 16:06:52

I am currently making a plugin for phonegap 3. I have a custom framework to copy using the source-file directive. In the plugin.xml I tried:

我目前正在制作一个phonegap 3的插件。我有一个可以使用源文件指令复制的自定义框架。在插件。xml我尝试:

<source-file src="libs/ios/mylib.framework" />

but I get the error when I add the plugin to my project:

但是当我将插件添加到我的项目时,我得到了错误:

mylib.framework is a directory (not copied)

框架是一个目录(没有复制)

I tried to copy the framework file by file but it is going in the wrong directory.

我试图逐个复制框架文件,但它在错误的目录中。

How can I copy a custom ios framework using the plugin.xml file?

如何使用插件复制自定义的ios框架。xml文件吗?

3 个解决方案

#1


24  

Good news: it seems that the Cordova folks are working on this as we speak. There is a feature request as well as a commit to GitHub that claims to resolve this issue. The framework tag will support the custom="true" attribute. For example, here's how you could do it for the AWS iOS SDK Runtime framework:

好消息:就在我们讲话的时候,科尔多瓦的人们似乎正在研究这个问题。有一个特性请求和一个提交给GitHub的承诺,声称可以解决这个问题。框架标签将支持自定义=“true”属性。例如,以下是AWS iOS SDK运行时框架的实现方法:

<framework src="src/ios/Frameworks/AWSRuntime.framework" custom="true" />

UPDATE: It seems that this change made it into the current stable release of Cordova on 11/29/2013 (two days ago). Just update your Cordova and Plugman binaries and you should be good to go.

更新:这一变化似乎使它在2013年11月29日(两天前)稳定地释放了科尔多瓦。只要更新你的Cordova和Plugman二进制文件,你就可以开始了。

$ npm update -g cordova  # if using `cordova plugin add xyz`
$ npm update -g plugman  # if using `plugman install --platform x --project y --plugin z`

#2


2  

You can copy the binary file (who should be in "mylib.framework/Versions/A/") and the headers ( ".h" who should be in "mylib.framwork/Versions/A/Headers")

可以复制二进制文件(应该在“mylib.framework/ version /A/”中)和头文件(“”)。h“谁应该在”mylib.framwork/ version /A/ header”中)

like this

像这样

<source-file src="libs/ios/mylib.framework/Versions/A/mylibBinary" framework="true" />
<header-file src="libs/ios/mylib.framework/Version/A/Headers/mylibHeader.h" />
...

You also have to add the dependencies manually, IE.: this framework needs the iOS AVFoundation.framework so, you need to add this too.

您还必须手动添加依赖项。:这个框架需要iOS AVFoundation.framework,所以您也需要添加这个。

<framework src="AVFoundation.framework" />

One more thing you have to know, if you want to submit this plugin to PhoneGap.

如果你想把这个插件提交给PhoneGap,你还需要知道一件事。

Plugin Submission Guidelines

Any application that contains binary libraries will be rejected. This is because we need to be able to see exactly what is in a plugin as part of our code review process. So when submitting a plugin make sure that it doesn’t contain binary libraries. (PhoneGap)

任何包含二进制库的应用程序都将被拒绝。这是因为我们需要能够准确地看到插件中的内容,作为代码检查过程的一部分。所以当提交一个插件时,确保它不包含二进制库。(PhoneGap)

#3


0  

Use <framework src="libs/ios/mylib.framework" />.

使用 <框架src = " libs ios mylib.framework> 。

#1


24  

Good news: it seems that the Cordova folks are working on this as we speak. There is a feature request as well as a commit to GitHub that claims to resolve this issue. The framework tag will support the custom="true" attribute. For example, here's how you could do it for the AWS iOS SDK Runtime framework:

好消息:就在我们讲话的时候,科尔多瓦的人们似乎正在研究这个问题。有一个特性请求和一个提交给GitHub的承诺,声称可以解决这个问题。框架标签将支持自定义=“true”属性。例如,以下是AWS iOS SDK运行时框架的实现方法:

<framework src="src/ios/Frameworks/AWSRuntime.framework" custom="true" />

UPDATE: It seems that this change made it into the current stable release of Cordova on 11/29/2013 (two days ago). Just update your Cordova and Plugman binaries and you should be good to go.

更新:这一变化似乎使它在2013年11月29日(两天前)稳定地释放了科尔多瓦。只要更新你的Cordova和Plugman二进制文件,你就可以开始了。

$ npm update -g cordova  # if using `cordova plugin add xyz`
$ npm update -g plugman  # if using `plugman install --platform x --project y --plugin z`

#2


2  

You can copy the binary file (who should be in "mylib.framework/Versions/A/") and the headers ( ".h" who should be in "mylib.framwork/Versions/A/Headers")

可以复制二进制文件(应该在“mylib.framework/ version /A/”中)和头文件(“”)。h“谁应该在”mylib.framwork/ version /A/ header”中)

like this

像这样

<source-file src="libs/ios/mylib.framework/Versions/A/mylibBinary" framework="true" />
<header-file src="libs/ios/mylib.framework/Version/A/Headers/mylibHeader.h" />
...

You also have to add the dependencies manually, IE.: this framework needs the iOS AVFoundation.framework so, you need to add this too.

您还必须手动添加依赖项。:这个框架需要iOS AVFoundation.framework,所以您也需要添加这个。

<framework src="AVFoundation.framework" />

One more thing you have to know, if you want to submit this plugin to PhoneGap.

如果你想把这个插件提交给PhoneGap,你还需要知道一件事。

Plugin Submission Guidelines

Any application that contains binary libraries will be rejected. This is because we need to be able to see exactly what is in a plugin as part of our code review process. So when submitting a plugin make sure that it doesn’t contain binary libraries. (PhoneGap)

任何包含二进制库的应用程序都将被拒绝。这是因为我们需要能够准确地看到插件中的内容,作为代码检查过程的一部分。所以当提交一个插件时,确保它不包含二进制库。(PhoneGap)

#3


0  

Use <framework src="libs/ios/mylib.framework" />.

使用 <框架src = " libs ios mylib.framework> 。