📌 Issue: When using app.LoadScript() or app.Include() in DroidScript, loaded scripts cannot access app in the compiled app, even though they work correctly in test mode.

86 views
Skip to first unread message

Sr Rimuru Tempest

unread,
Jun 11, 2025, 7:20:58 PMJun 11
to DroidScript

📌 Issue: When using app.LoadScript() or app.Include() in DroidScript, loaded scripts cannot access app in the compiled app, even though they work correctly in test mode.

📌 Example:

// In main.js
app.LoadScript("views/inicio.js", function() {
    MostrarBoton(); // Error: function not found
});

// In views/inicio.js
function MostrarBoton() {
    var layout = app.CreateLayout("linear", "VCenter,FillXY"); // Error: "app.CreateLayout is not a function"
    app.AddLayout(layout);
}


// In views/inicio.js
function MostrarBoton() {
    var layout = app.CreateLayout("linear", "VCenter,FillXY"); // Error: "app.CreateLayout is not a function"
    app.AddLayout(layout);
}

  How can we ensure that scripts loaded via LoadScript() or Include() can access app in the compiled app?  

Dave

unread,
Jun 12, 2025, 4:55:05 AMJun 12
to DroidScript
It should work, check the case of the filenames matches your code, because file names are case sensitive inside APKs but not outside.
Reply all
Reply to author
Forward
0 new messages