Invalid method (createToolbar) passed to UIModule on device
Hey. I'm trying to create a toolbar on a modal window and it works well on simulator. But after installing to the device and then it shows the error "invalid method (createToolbar) passed to UIModule on device. The version is Titanium 1.4.2, iOS 4.2, iTouch 2nd generation.
The codes are as following,
var postWin = Titanium.UI.createWindow({
url:'../javascripts/post.js',
title:'New Update'
});
postWin.open({modal:true,animated:true});
In post.js
var win = Titanium.UI.currentWindow;
var flexSpace = Titanium.UI.createButton({
systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
});
// create and add toolbar
var toolbar1 = Titanium.UI.createToolbar({
items:[flexSpace],
bottom:0,
borderTop:true,
borderBottom:false,
translucent:true,
barColor:'#999'
});
win.add(toolbar1);
Any guides are welcome. Thanks very much!
7 Answers
-
One thing to remember is that when you do a full build Titanium removes unused components from their API. So if you are adding a new type of component, for example, there are no textAreas in your app, and then you add a textArea, you may get this error.
The solution is to force a total rebuild by clearing out the contents of your build/iphone directory
-
I had a similar issue, but discovered it was related to Titanium not knowing which modules to include in the build. As I was using Redux, calls such as Titanium.UI.createLabel were not detected by the Titanium builder and thus references to the Label UI module were not included. I wrote some code similar to this to solve the issue:
(function() {
var used = [
Titanium.UI.createActivityIndicator,
Titanium.UI.createWindow
];
})(); -
Any word on this, I have spent all day trying to run down this bug also
-
Oh my days, not quite the same but similar. I am having Invalid method (createWindow) in simulator and cant even install onto device! Whats worse is that it was working last night when I left my development machine - untouched!
Someone at appcelerator going to pitch in? Hope someone can spread some light on this!
-
i made some progress, if i take the exact same project and put a new app.js in, it works fine… so now I need to see what is wrong with the code in the app.js
-
I'm also having a similar issue with 1.5.0 and SDK 4.2, was working and now for an unknown reason it doesn't work, if i delete the build folder, run on simulator it works correctly, if i delete the build folder build for device it doesn't work on the device and when i attempt to view in the simulator it also no longer works.
The errors are:
[WARN] attempted to load: TiUITabGroupProxy
[ERROR] Script Error = invalid method (createTabGroup) passed to UIModule at app.js (line 1).
[ERROR] application received error: invalid method (createTabGroup) passed to UIModule at app.js (line 1)
[DEBUG] application booted in 275.932014 ms -
I had a similar issue. I moved all code inside app.js to an include file app-window.js to solve this error
Take a look on "SOLUTION?!" on this link http://developer.appcelerator.com/question/100971/get-crash-log-from-iphone#179941