Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-14661

Cannot have a plugin if the project is for both Android and iOS



      You effectively cannot have any plugin if the project is for both Android and iOS. Android currently requires python plugins. iOS currently requires js plugins.

      I ported an old python plugin to a new js plugin for iOS (thanks to the example at http://appersonlabs.com/2013/04/12/titanium-build-plugins-in-sdk-3-x-x/) and it worked great.

      Then I tried to build for Android, and it failed the build saying the plugin is missing. So I created a essentially empty python plugin in that folder:

      def compile(config)
          #don't do anything
          #when android gets on board with js plugins, delete me!
          myconfig = config

      I then discovered that the Android build actually calls the new js plugin if present, but the function parameters aren't set. I was able to work around this in the js plugin by checking to make sure the parameters aren't null before proceeding. It then calls the empty python plugin as usual, as well as all of my other legacy python plugins (that don't have also .js files in them).

      But then the iOS plugin silently ceased to be executed. The iOS build silently ignores a js plugin if it also has a python file present. The developer put a comment in the code at about line 292 of /titatium-sdk/lib/titanium.js:

      // we don't support plugins that have both a plugin.py and new .js files

      It would have spared me the time of digging through titanium's code if the developer had put that comment into a log entry. But I digress.

      Hopefully the easiest fix is also the best one (in my outside-looking-in opinion): the exact opposite of what is done in the js cli at line 292 above should be done here. Instead of ignoring the js plugin, it should ignore the python file with a debug or warn message. It should not be an error or fail the build. In fact, the js cli already ignores the python plugins, so perhaps all that needs to be done here is to not ignore a js plugin when a py plugin is present.

      I understand if you didn't have time to port android to js along with iOS, but you have effectively broken plugins for both platforms, and that is disappointing to me. It's been coming up on a year since the js cli was released. That's a long time for you to leave us hanging without a prior functionality, or documentation of the new plugin api.

      When will android be ported to the new js cli? When you will document the new js plugin api?




            • Assignee:
              cbarber Chris Barber
              strautman Steve Trautman
            • Watchers:
              1 Start watching this issue


              • Created:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  Sync status:
                  Last received:
                  Last sent:

                  Git Integration