Custom plugin headache

4 posts, 1 answers
  1. X
    X avatar
    2 posts
    Member since:
    Aug 2013

    Posted 03 Sep 2013 Link to this post

    I'm interested in having a look at some augmented reality plugins that are out there already (Wikitude, Moodstocks).
    I've been able already to use some custom plugins like PowerManagement and Version, but I don't know how to approach the implementation of these ones, as they use their SDK and I don't know what to do with the files.

    Any help please?
    Thank you
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 04 Sep 2013 Link to this post

    Hello,

    To add reference to a framework, you can use the source-file and framework tags inside the plugin.xml file:

    ....
    <source-file src="src/<platform>/frameworks/SDK.a" framework="true" />
    ....
    <framework src="SOME.framework" weak="true" />
      </platform>
    </plugin>

    You can refer to a plugin that is already plugman compatible and has a plugin.xml file available, so you can use it as a base e.g.: https://github.com/phonegap-build/FacebookConnect/blob/master/plugin.xml

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  3. X
    X avatar
    2 posts
    Member since:
    Aug 2013

    Posted 04 Sep 2013 Link to this post

    I'm trying to implement Wikitude Plugin (at least for android).

    My Plugins folder structure is this one:
    Plugins
       - Wikitude
          - src
             - com
                - wikitude
                   - phonegap
                      - WikitudePlugin.java
                      - WikitudePluginExtended.java
          - www
             - WikitudePlugin.js
          - lib
             - wikitudesdk.jar
          - plugin.xml

    I have modified the Android Configuration to add the plugin reference.
    I have used in the plugin.xml:
     <framework src="lib/wikitudesdk.jar" weak="true" />

    But when I try to build my app an error is thrown:
    TypeError: Cannot read property 'install' of undefined at /Users/builder/Cordova/node_modules/plugman/src/install.js:147:66 at Array.forEach (native) at handleInstall (/Users/builder/Cordova/node_modules/plugman/src/install.js:146:30) at runInstall (/Users/builder/Cordova/node_modules/plugman/src/install.js:111:9) at /Users/builder/Cordova/node_modules/plugman/src/install.js:34:17 at Object.fetchPlugin [as fetch] (/Users/builder/Cordova/node_modules/plugman/src/fetch.js:39:23) at possiblyFetch (/Users/builder/Cordova/node_modules/plugman/src/install.js:29:31) at Object.installPlugin [as install] (/Users/builder/Cordova/node_modules/plugman/src/install.js:19:5) at Object.(/Users/builder/Cordova/node_modules/plugman/main.js:77:13) at Module._compile (module.js:456:26)

    Any help?
  4. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 04 Sep 2013 Link to this post

    Hello,

    For Android, adding a reference to a jar file has to be in source-file e.g.:

    <source-file src="<path>/wikitudesdk.jar" />

    See plugin.xml Manifest Format for more information.

    Regards,
    Steve
    Telerik

    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top