Problem
Email Dialog crashes android on CI builds of 1.8
Works fine on earlier versions.
Sample Code
var win = Ti.UI.createWindow();
var btn = Ti.UI.createButton({
title:'here'
});
win.add(btn);
win.open();
btn.addEventListener('click', function(){
var emailDialog = Titanium.UI.createEmailDialog();
emailDialog.setSubject('Hello from Titanium!');
emailDialog.setToRecipients(['foo@yahoo.com']);
emailDialog.setCcRecipients(['bar@yahoo.com']);
emailDialog.setBccRecipients(['blah@yahoo.com']);
emailDialog.addEventListener('complete',function(e)
{
if (e.result == emailDialog.SENT)
{
if (Ti.Platform.osname != 'android') {
// android doesn't give us useful result codes.
// it anyway shows a toast.
alert("message was sent");
}
}
else
{
alert("message was not sent. result = " + e.result);
}
});
emailDialog.open();
});
Log
07-08 15:56:37.334: ERROR/KrollMethod(509): (kroll$1: app://app.js) [5836,30550] Exception calling kroll method open, invocation: null ]
07-08 15:56:37.334: ERROR/KrollMethod(509): java.lang.NullPointerException
07-08 15:56:37.334: ERROR/KrollMethod(509): at ti.modules.titanium.ui.EmailDialogProxy.getAttachmentUris(EmailDialogProxy.java:251)
07-08 15:56:37.334: ERROR/KrollMethod(509): at ti.modules.titanium.ui.EmailDialogProxy.buildIntent(EmailDialogProxy.java:115)
07-08 15:56:37.334: ERROR/KrollMethod(509): at ti.modules.titanium.ui.EmailDialogProxy.open(EmailDialogProxy.java:139)
07-08 15:56:37.334: ERROR/KrollMethod(509): at ti.modules.titanium.ui.EmailDialogProxyBindingGen$2.invoke(EmailDialogProxyBindingGen.java:142)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:164)
07-08 15:56:37.334: ERROR/KrollMethod(509): at android.os.Handler.handleCallback(Handler.java:587)
07-08 15:56:37.334: ERROR/KrollMethod(509): at android.os.Handler.dispatchMessage(Handler.java:92)
07-08 15:56:37.334: ERROR/KrollMethod(509): at android.os.Looper.loop(Looper.java:123)
07-08 15:56:37.334: ERROR/KrollMethod(509): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
07-08 15:56:37.354: ERROR/KrollCallback(509): (kroll$1: app://app.js) [13,30563] Error evaluating source, invocation: [callMethod UI.Button.UI.Button:event:click null], message: Wrapped java.lang.NullPointerException (file:///android_asset/Resources/app.js#33)
07-08 15:56:37.354: ERROR/KrollCallback(509): org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (file:///android_asset/Resources/app.js#33)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:85)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
07-08 15:56:37.354: ERROR/KrollCallback(509): at script(file:///android_asset/Resources/app.js:33)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:164)
07-08 15:56:37.354: ERROR/KrollCallback(509): at android.os.Handler.handleCallback(Handler.java:587)
07-08 15:56:37.354: ERROR/KrollCallback(509): at android.os.Handler.dispatchMessage(Handler.java:92)
07-08 15:56:37.354: ERROR/KrollCallback(509): at android.os.Looper.loop(Looper.java:123)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
07-08 15:56:37.354: ERROR/KrollCallback(509): Caused by: java.lang.NullPointerException
07-08 15:56:37.354: ERROR/KrollCallback(509): at ti.modules.titanium.ui.EmailDialogProxy.getAttachmentUris(EmailDialogProxy.java:251)
07-08 15:56:37.354: ERROR/KrollCallback(509): at ti.modules.titanium.ui.EmailDialogProxy.buildIntent(EmailDialogProxy.java:115)
07-08 15:56:37.354: ERROR/KrollCallback(509): at ti.modules.titanium.ui.EmailDialogProxy.open(EmailDialogProxy.java:139)
07-08 15:56:37.354: ERROR/KrollCallback(509): at ti.modules.titanium.ui.EmailDialogProxyBindingGen$2.invoke(EmailDialogProxyBindingGen.java:142)
07-08 15:56:37.354: ERROR/KrollCallback(509): at org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)
07-08 15:56:37.354: ERROR/KrollCallback(509): ... 12 more
07-08 15:56:37.354: ERROR/TiJSError(509): (kroll$1: app://app.js) [19,30582] ----- Titanium Javascript Runtime Error -----
07-08 15:56:37.365: ERROR/TiJSError(509): (kroll$1: app://app.js) [7,30589] - In file:///android_asset/Resources/app.js:33,0
07-08 15:56:37.385: ERROR/TiJSError(509): (kroll$1: app://app.js) [12,30601] - Message: Wrapped java.lang.NullPointerException (file:///android_asset/Resources/app.js#33)
07-08 15:56:37.385: ERROR/TiJSError(509): (kroll$1: app://app.js) [4,30605] - Source: null
Also exists on Android API 2.2 and API 2.3.1, Ti SDK mobilesdk-1.8.0.v20110624140238-osx. See TC-112
Rick and Paul this should be fixed with TIMOB-4724 which will be in 1.7.2 and 1.8.0. Please verify that it is fixed. If so then close this ticket as duplicate.
May be duplicate. Linking to make it easier to find.
Tested on 1.8.0 (08/08/11 16:29 367a39e...) and it is not crashing. Closing.
Tested with 1.8.0.v20110819142548 iPhone 4.3.4 iPad2 4.3.2 Motorola Xoom 3.2 Nexus One 2.2.2