appcelerator-developer-relations / forging-titanium Goto Github PK
View Code? Open in Web Editor NEWA weekly screencast series on Titanium development topics
Home Page: http://www.appcelerator.com
A weekly screencast series on Titanium development topics
Home Page: http://www.appcelerator.com
I tried launching the example on Android using SDK 1.7.2, and it crashes. Here's the stacktrace:
E/TitaniumModule( 409): (kroll$1: app://app.js) [1,1055] Error loading module named: NavigationController
E/TitaniumModule( 409): java.lang.IllegalArgumentException: size < 0
E/TitaniumModule( 409): at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:65)
E/TitaniumModule( 409): at org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106)
E/TitaniumModule( 409): at org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120)
E/TitaniumModule( 409): at org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216)
E/TitaniumModule( 409): at ti.modules.titanium.TitaniumModule.require(TitaniumModule.java:431)
E/TitaniumModule( 409): at ti.modules.titanium.TitaniumModuleBindingGen$23.invoke(TitaniumModuleBindingGen.java:875)
E/TitaniumModule( 409): at org.appcelerator.kroll.KrollProxy$ThisMethod.invoke(KrollProxy.java:397)
E/TitaniumModule( 409): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)
E/TitaniumModule( 409): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
E/TitaniumModule( 409): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
E/TitaniumModule( 409): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
E/TitaniumModule( 409): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
E/TitaniumModule( 409): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
E/TitaniumModule( 409): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
E/TitaniumModule( 409): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)
E/TitaniumModule( 409): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105)
E/TitaniumModule( 409): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306)
E/TitaniumModule( 409): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318)
E/TitaniumModule( 409): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217)
E/TitaniumModule( 409): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223)
E/TitaniumModule( 409): at android.os.Handler.dispatchMessage(Handler.java:95)
E/TitaniumModule( 409): at android.os.Looper.loop(Looper.java:130)
E/TitaniumModule( 409): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
E/KrollMethod( 409): (kroll$1: app://app.js) [20,1075] Exception calling kroll method require, invocation: null ]
E/KrollMethod( 409): org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0 (file:///android_asset/Resources/app.js#2)
E/KrollMethod( 409): at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786)
E/KrollMethod( 409): at ti.modules.titanium.TitaniumModule.require(TitaniumModule.java:453)
E/KrollMethod( 409): at ti.modules.titanium.TitaniumModuleBindingGen$23.invoke(TitaniumModuleBindingGen.java:875)
E/KrollMethod( 409): at org.appcelerator.kroll.KrollProxy$ThisMethod.invoke(KrollProxy.java:397)
E/KrollMethod( 409): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)
E/KrollMethod( 409): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
E/KrollMethod( 409): at script(file:///android_asset/Resources/app.js:2)
E/KrollMethod( 409): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
E/KrollMethod( 409): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
E/KrollMethod( 409): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
E/KrollMethod( 409): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
E/KrollMethod( 409): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
E/KrollMethod( 409): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)
E/KrollMethod( 409): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105)
E/KrollMethod( 409): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306)
E/KrollMethod( 409): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318)
E/KrollMethod( 409): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217)
E/KrollMethod( 409): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223)
E/KrollMethod( 409): at android.os.Handler.dispatchMessage(Handler.java:95)
E/KrollMethod( 409): at android.os.Looper.loop(Looper.java:130)
E/KrollMethod( 409): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
E/KrollMethod( 409): Caused by: java.lang.IllegalArgumentException: size < 0
E/KrollMethod( 409): at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:65)
E/KrollMethod( 409): at org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106)
E/KrollMethod( 409): at org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120)
E/KrollMethod( 409): at org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216)
E/KrollMethod( 409): at ti.modules.titanium.TitaniumModule.require(TitaniumModule.java:431)
E/KrollMethod( 409): ... 18 more
E/KrollContext( 409): (kroll$1: app://app.js) [11,1086] Error evaluating source: Wrapped java.lang.IllegalArgumentException: size < 0 (file:///android_asset/Resources/app.js#2)
E/KrollContext( 409): org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalArgumentException: size < 0 (file:///android_asset/Resources/app.js#2)
E/KrollContext( 409): at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786)
E/KrollContext( 409): at ti.modules.titanium.TitaniumModule.require(TitaniumModule.java:453)
E/KrollContext( 409): at ti.modules.titanium.TitaniumModuleBindingGen$23.invoke(TitaniumModuleBindingGen.java:875)
E/KrollContext( 409): at org.appcelerator.kroll.KrollProxy$ThisMethod.invoke(KrollProxy.java:397)
E/KrollContext( 409): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)
E/KrollContext( 409): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
E/KrollContext( 409): at script(file:///android_asset/Resources/app.js:2)
E/KrollContext( 409): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
E/KrollContext( 409): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
E/KrollContext( 409): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
E/KrollContext( 409): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
E/KrollContext( 409): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
E/KrollContext( 409): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)
E/KrollContext( 409): at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105)
E/KrollContext( 409): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306)
E/KrollContext( 409): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318)
E/KrollContext( 409): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217)
E/KrollContext( 409): at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223)
E/KrollContext( 409): at android.os.Handler.dispatchMessage(Handler.java:95)
E/KrollContext( 409): at android.os.Looper.loop(Looper.java:130)
E/KrollContext( 409): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
E/KrollContext( 409): Caused by: java.lang.IllegalArgumentException: size < 0
E/KrollContext( 409): at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:65)
E/KrollContext( 409): at org.appcelerator.titanium.util.TiStreamHelper.toByteArray(TiStreamHelper.java:106)
E/KrollContext( 409): at org.appcelerator.titanium.TiBlob.getBytes(TiBlob.java:120)
E/KrollContext( 409): at org.appcelerator.titanium.TiBlob.getText(TiBlob.java:216)
E/KrollContext( 409): at ti.modules.titanium.TitaniumModule.require(TitaniumModule.java:431)
E/KrollContext( 409): ... 18 more
E/TiJSError( 409): (kroll$1: app://app.js) [8,1094] ----- Titanium Javascript Runtime Error -----
E/TiJSError( 409): (kroll$1: app://app.js) [1,1095] - In file:///android_asset/Resources/app.js:2,0
E/TiJSError( 409): (kroll$1: app://app.js) [1,1096] - Message: Wrapped java.lang.IllegalArgumentException: size < 0 (file:///android_asset/Resources/app.js#2)
E/TiJSError( 409): (kroll$1: app://app.js) [1,1097] - Source: null
Hi Kevin,
I had to comment out line 12 of NavigationController.js to get things to correctly function across the two platforms, not sure exactly what's going on, but if i went, in, out, in, out it would loose it's place.
Also we created a back function where you don't want to go home, w.close() didn't always work so our function checks the platform see:
//go back one window NavigationController
exports.NavigationController.prototype.back = function(w) {
if(Ti.Platform.osname === 'android') {
w.close();
}else{
this.navGroup.close(w);
}
};
I'm getting "Wrapped java.lang.IllegalArgumentException: size < 0" on Android with the monkeypatch function. Any thoughts on what might cause this?
Thanks,
the picker in modal windows seems to appear and disappear.
it seems, it lays behind my window
We found that this just didn't work at all cross platform, it seems to work until you package it for the app store at which point it fails, i am not sure whether this is an issue with require in the packager?
In the meantime i converted it to a non CommonJS module and that fixed the issue:
I got the null values for TYPE_PICKER AND TYPE_DATE. What's the problem? I added a alert statement after Ti.API.debug(e) within forms.addEventListener. Any suggestion. Thanks.
The code throws the following error:
startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK and essentially starts the app again. I'm trying to use the notification to get back from a background audio app, and it starts the app again, causing to have two audio streams play on top of each other.
Tried various configurations options, but the error remains. Any idea how to set it up to run in a single context?
Completely broken, obvious layout problems. Any easy fixes?
Tony I think you saw my centred menu implementation, here is a gist, I have managed to centre the menuButton, but the surround icons just will not bounce to the correct position on the Y axis, they all appear on one X axis. https://gist.github.com/2406021
I opened up 15 windows and then clicked on the Home button and the app crashed and I can't start it again even after cleaning my project.
How would I implement this inside a tabGroup???
I have a tabGroup at app.js and I would like to have a NavigationController inside each tab.
How would I do that? Any ideas or most importantly, examples?
Thanks
I added an eventListener to the textfield to make it behave like the rightButton, same exact code, except I'm using "e.source.blur();" instead of "textField.blur();" -- I think the keyboard height is somehow being calculated into this.
After opening the semiModalPicker, the window containing the form height is lengthened, pushing the form up and leaving extra space below it.
[ERROR] Script Error = *** -[NSCFString substringToIndex:]: Range or index out of bounds at app.js (line 2).
i enterd Twilio APPLICATION_SID and AUTH_TOKEN.
Hi, the demo crashes, because there is an error
line 3 controller is not found. i quess it should be the navController.
line 15 TestWindow is not found... well to solve this you can give the declaration function a name like Like Window and constuct it, using new window.
exports.TestWindow = function Window(navController) { //named function Window
var win = Ti.UI.createWindow({
title:'Window '+navController.windowStack.length, //used the param instead of global
backgroundColor:'#fff',
layout:'vertical'
});
var add = Ti.UI.createButton({
title:'Add A New Window',
height:'50dp',
width:'200dp',
top:'20dp'
});
add.addEventListener('click', function() {
navController.open(new Window(navController)); //call named constructor
});
.....
Now it works fine on Android and iOS.
Regards
Aleksejs Okolovskis
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.