Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for SDK 8.x? #51

Open
chmiiller opened this issue Oct 29, 2019 · 5 comments
Open

Support for SDK 8.x? #51

chmiiller opened this issue Oct 29, 2019 · 5 comments

Comments

@chmiiller
Copy link

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!

@yuchi
Copy link
Member

yuchi commented Nov 21, 2019

@Robbe92 can you please a look at this? (@chmiiller sorry for the delay)

@chmiiller
Copy link
Author

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 ¯_(ツ)_/¯

@Robbe92
Copy link
Member

Robbe92 commented Nov 21, 2019

Thanks Carlos,
very interesting bug and solution!
Did you open issue to axway?

@chmiiller
Copy link
Author

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

@chmiiller
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants