Software Archive
Read-only legacy content
17061 Discussions

cordova local plugin

ale_d_
Beginner
1,265 Views

Hello I have this kind of problem:

1) I need to import a plugin from github to include it locally (this is because this issue @ https://github.com/Wizcorp/phonegap-facebook-plugin Cordova Registry warning iOS)

2) I obtained a clone of the git and I saved automatically from GitHub desktop into phonegap-facebook-plugin folder into my application main directory. Inside this folder there are plugin.xml, platforms and .cordova folder and so on

3) I tried to include the plugin via Include local plugin but it fails when builds (both ios and android). That's why the plugin requires 2 parameters: APP_ID and APP_NAME

4) So, where can I find some example about how to use intelxdk.config.additions.xml (or .crosswalk.xml or .ios.xml) to add local plugin so I can set parameters? i tried with this code into config.additions.xml (and .config.crosswalk.xml) file and it fails during building

 

<intelxdk:plugin intelxdk:name="my facebook new" intelxdk:value="C:\Developer\XDK\LocalMed\phonegap-facebook-plugin" intelxdk:id="com.phonegap.plugins.facebookconnect"> <intelxdk:param intelxdk:name="APP_ID" intelxdk:value="myappid" /> <intelxdk:param intelxdk:name="APP_NAME" intelxdk:value="myappname" /> </intelxdk:plugin>

please help me

0 Kudos
1 Solution
John_H_Intel2
Employee
1,249 Views

I was able to replicate this and filed a bug. I will post back when it has been fixed.

Also, it does work in the regular XDK.

View solution in original post

0 Kudos
23 Replies
Alessandro_S_
Beginner
126 Views
Any solution?
0 Kudos
PaulF_IntelCorp
Employee
126 Views

@Alessandro -- The problem has not been resolved.

Here's the root cause as determined by engineering:

The root cause is that the plugin contains symbolic links, which are lost (converted to plain text files) in Windows. Whether you use `git clone` or download the git zip file and unzip, the symlinks are converted to plain text files in Windows. So when it is uploaded to the builder, it remains plain text. If you do the exact process but on Mac, the build succeeds, because the symlinks are retained in Mac/Linux.

It's not obvious, but this is the reason it fails for EA but succeeds with the mainstream XDK, because the mainstream does not rely on a local copy of the plugin to perform the build, but the EA version does.

This is a known Cordova issue: https://issues.apache.org/jira/browse/CB-6092

A workaround for the EA release (and for our upcoming mainstream release) is to reference the plugin in the additions.xml file, which is not processed by the XDK, but only by the build system. So that would be done by adding the following lines into your intelxdk.config.additions.xml file:

<intelxdk:plugin intelxdk:name="Facebook* Connect" intelxdk:value="https://github.com/Wizcorp/phonegap-facebook-plugin.git#0.11.0">
    <intelxdk:param intelxdk:name="APP_ID" intelxdk:value="my-app-id"/>
    <intelxdk:param intelxdk:name="APP_NAME" intelxdk:value="my-app-name"/>
</intelxdk:plugin>

The above assumes you want to use the latest v0.11.0 release. The default that is being specified in the current release is 0.10.1, so you'd have to change the git tag ref to 0.10.1 to use that version. See the repo for that plugin for all the release version numbers. Note that you need to substitute your APP_ID and APP_NAME into the appropriate fields. See this doc page for details describes the additions.xml file: https://software.intel.com/en-us/xdk/docs/adding-special-build-options-to-your-xdk-cordova-app-with-the-intelxdk-config-additions-xml-file

p.s. This helps resolve the issue for Android and iOS builds because those build systems use Linux and OSX, respectively. However, it may still fail for a Windows build due to the fact that those build systems run on Windows, and that is where the problem appears.

0 Kudos
PaulF_IntelCorp
Employee
126 Views

Engineering is testing a solution for this problem in the build system that should be deployed in a week or two. When that solution is deployed to the production build system it will allow the EA builds that use this plugin (and others like it) to build properly.

0 Kudos
Reply