titaniumifier
titaniumifier copied to clipboard
Support for SDK 8.x?
When I try to use my previously titaniumified module on Android with Titanium SDK 8.x I get an:
context.sourceUrl = url;
TypeError: Cannot create property 'sourceUrl' on boolean 'true'
error. I have no idea where this is coming from since I can't find anything called sourceUrl
in any code in my project. Does anyone have an idea on how to fix it?
Thanks!
@Robbe92 can you please a look at this? (@chmiiller sorry for the delay)
No problems, thanks for having a look at this. We made some progress and it appears that loading modules from a function scope is the problem on Android and something in Titanium 8.x has changed with how modules are scoped and what kind of objects they can reference.
Here is what a colleague of mine found out so far:
Doing something like:
(function(bla) { var tiws = require('net.iamyellow.tiws'); }());
Leads to problems on Android, when loading native Titanium modules. This is really weird, because in Node.js loading modules from function scopes work fine, as well as on iOS/Titanium.
I have managed to fix that problem by manually editing the ti-simple-xmpp.js file, take that require() statement line from the function scope, and moving it to the top of the file, effectively putting it in the global scope. With this modified version, the app starts properly and no longer crashes on startup.
It might be something to start with ¯_(ツ)_/¯
Thanks Carlos, very interesting bug and solution! Did you open issue to axway?
It is still not working, and I'm not sure if this is something that Axway can help me with but I've sent it all to an Axway developer, let's see if he has something to add to it later
Update: Jan from Axway found out that the code from Titaniumifier produces require() with a second argument, true, which is causing the problem somehow. Here is what he's found so far: https://jira.appcelerator.org/browse/TIMOB-27633