Titanium Appcelerator : Application Error : Runtime Error: unknown Exception - windows-phone

I am using :
System
Name = Microsoft Windows 10 Pro
Version = 10.0.10586
Architecture = 64bit
Titanium SDK 5.4.0.v20160601151241 (active)
Version = 5.4.0
Platforms = android, mobileweb, windows
node-appc Version = 0.2.35
Java Development Kit
Version = 1.7.0_80
Microsoft (R) Visual Studio
14.0 (selected)
CLR Version = v4.0.30319
MSBuild Version = v14.0.25123.0
Microsoft (R) Windows Phone SDK
10.0
8.1
Windows Phone Devices : Lumia 540 Dual SIM (RM-1141)
When I Run my widget that closes one window and initializes a controller to display another window, I get error :
Application Error
Runtime Error: unknown Exception
Appcelerator When your app is packaged for final distribution, no error screen will appear.
Can someone please guide on where can I find the file for this error so I can try-catch this error for better understanding or detail on this....
Also if someone can explain this error.
I found some reference at : https://github.com/appcelerator/titanium_mobile_windows/blob/master/Source/TitaniumKit/src/Application.cpp
But could not find this file to add logs in the file.

I encounter the similar problem today morning! Only to find out
"borderRadius : '5%'" was throwing the error.
`var _viewMask = Ti.UI.createView({
borderWidth:0,
height : v2,
width: v2, borderRadius : '5%'
});`
You may have similar syntax which may not be valid & that is causing this type of error..
why not check this & solve it?

Related

How to make Titanium (SDK) work?

After an update to Titanium SDK 3.5.0 on MacBooks with Yosemite there occur several issues on all my developer machines, which prevents me from working on current projects:
The issues
"ti info" stops due to an exception in longjohn.js (see attached below)
"ti setup" stops with another exception while spawning a childProcess
Titanium Studio doesnt find my iOS SDK, although there is at least iOS SDK 8.1 installed and work perfectly in XCode (further information provided below)
After each start of Titanium Studio there occurs an error dialog stating "An internal error occured during Computing SDK Info, java.lang.NullPointerException", which seems to be related to the Issue under #3, which i mentioned above.
Because of the points mentioned above it is not possible to build any iOS Application with titanium
The installed versions:
node: 0.12.0
npm: 2.5.1
Titanium CLI: 3.4.1.201410281727
Titanium SDK version: 3.5.0.GA
java: 1.8.0_25
OSX: 10.10.2 (Yosemite)
XCode: 6.1.1
iOS SDK: 8.1
The error messages
1. "ti info": (in terminal)
Titanium Command-Line Interface, CLI version 3.4.1, Titanium SDK version 3.5.0.GA
Copyright (c) 2012-2014, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
|[ERROR] Failed to run command "info"
/usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:185
throw e;
^
logger.log (/usr/local/lib/node_modules/titanium/lib/logger.js:72:21),target.(anonymous function) [as error] (/usr/local/lib/node_modules/titanium/node_modules/winston/lib/winston/common.js:45:21),CLI.<anonymous> (/usr/local/lib/node_modules/titanium/lib/cli.js:955:17),/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:119:25,Object.<anonymous> (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:24:16),CLI._fireHookCallback (/usr/local/lib/node_modules/titanium/lib/hook.js:269:12),/usr/local/lib/node_modules/titanium/lib/hook.js:248:10,/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:232:13,async.eachSeries (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:130:20)
ha
2. "ti setup" (terminal)
> Where do you want to go? 1
|[ERROR] TypeError: Incorrect value of args option
at normalizeSpawnArguments (child_process.js:952:11)
at exports.spawn (child_process.js:984:38)
at run (/Users/<user>/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.GA/node_modules/node-appc/lib/subprocess.js:47:14)
at Object.detect (/Users/<user>/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.GA/node_modules/node-appc/lib/jdk.js:71:3)
at async.parallel.jdk (/Users/<user>/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.GA/node_modules/titanium-sdk/lib/android.js:71:13)
at /Users/<user>/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.GA/node_modules/async/lib/async.js:524:25
at /Users/<user>/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.GA/node_modules/async/lib/async.js:111:13
at Array.forEach (native)
at _each (/Users/<user>/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.GA/node_modules/async/lib/async.js:32:24)
at async.each (/Users/<user>/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.GA/node_modules/async/lib/async.js:110:9)
3. Titanium Studio doesnt find any iOS SDK:
I already executed:
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Then i enter "Titanium Studio -> Preferences -> Studio -> Platforms -> iOS". The setting for iOS SDK Home is empty and shows "Not specified".
But iOS SDK for 8.1 is already installed:
Some important messages from the Titanium Studio Log File:
!MESSAGE An internal error occurred during: "Computing SDK Info...".
!STACK 0
java.lang.NullPointerException
at com.appcelerator.titanium.ui.portal.processor.MobileSDKConfigurationHelper.getVersionInfo(MobileSDKConfigurationHelper.java:133)
at com.appcelerator.titanium.ui.portal.processor.MobileSDKConfigurationProcessor.computeStatus(MobileSDKConfigurationProcessor.java:74)
at com.aptana.configurations.processor.AbstractConfigurationProcessor.getStatus(AbstractConfigurationProcessor.java:154)
at com.appcelerator.titanium.ui.portal.actionController.MobileSDKActionController$1.run(MobileSDKActionController.java:127)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
!MESSAGE An internal error occurred during: "Sending Analytics Ping ...".
!STACK 0
java.lang.NullPointerException
at com.aptana.usage.internal.DefaultAnalyticsEventHandler.getAnalyticsLogger(DefaultAnalyticsEventHandler.java:207)
at com.aptana.usage.internal.DefaultAnalyticsEventHandler.sendEventSync(DefaultAnalyticsEventHandler.java:241)
at com.aptana.usage.internal.DefaultAnalyticsEventHandler$1.run(DefaultAnalyticsEventHandler.java:75)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
!ENTRY com.aptana.core 4 1 2015-02-20 11:37:18.555
!MESSAGE sudo: a password is required
!ENTRY com.appcelerator.titanium.core 4 0 2015-02-20 11:38:17.801
!MESSAGE (Build 3.4.1.201410281727) [ERROR] Unable to locate the CLI executable. Please restart Studio or use Help > Check for Titanium Updates to install Titanium CLI.
(Funny side effect: asking questions like this one in appcelerators developer forum will be rejected immediatly with the message "This data was not accepted because it was flagged as spam." (i tried it out in multiple variations))
What can i do know?
Using the older version of Node (10.33) resolved the issue for me.
I used the node package manager to install "n" which allows you to switch versions (you'll need to run it as sudo):
npm install -g n
Then switch the version, also as sudo:
n 0.10.33
Funny fact: Appcelerator Titanium isn't working with Node 0.12.
To solve all these issues with one step i only needed to switch back from Node 0.12 to Node 0.10.35.
(OS Yosemite)
If anyone else is having this issue, please check permissions to the following folder:
/Users/user.folder/Library/Application Support/Titanium/mobilesdk/osx/
Make sure to apply permissions to all subfolders / files. I had a permissions issue on my machine, after re-installing titanium 2 times, downgrading node to all kinds of different versions, and following all instructions in various stacked overflow threads.

IBM Worklight SimpleDialog platforms limits

I am using Worklight 6.0 for an application working on 4 platforms (iOS, Android, Blackberry and Windows Phone 8).
While using WL.SimpleDialog I can notice today that the handler button option/callback does not work on Blackberry 10. Also when reading the documentation at http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.0.0/com.ibm.worklight.help.doc/apiref/r_wl_simpledialog_show.html there is nothing that mention that.
For the test on Blackberry, I am using Webworks 10 version 2.2, and I am inspecting the device.
I call the SimpleDialog this way:
WL.SimpleDialog.show("Alert", "Popup message", [{text:"ok", handler: function() {
console.log("hello") ;
}}]);
The message "hello" is not appearing on console after I press the button and there are no errors appearing on console too.
Update : One more detail: I checked an old version, compiled 1 year ago with webworks 1.0, and handler is working for the old version.
Is this an issue related to Worklight 6.0 and Blackberry Webworks 2.2 ?
Do you confirm that the handler option is not supported for Blackberry ? also is it supported for Windows Phone ?
Update: Fix for WL.SimpleDialog is available starting November 25th, 2014. You should be able to download the latest 6.0.0.x iFix from IBM Fix Central (or request it via a support request (PMR)).
Per the Common UI Controls training module (slide #13):
When you use WL.SimpleDialog in Windows Phone 8, you can use at most
four buttons in each instance of WL.SimpleDialog.
When you use WL.SimpleDialog in Android, you can use at most three
buttons in each instance of WL.SimpleDialog.
As for the callback in BlackBerry 10, it should work. Are you getting any errors?
Also provide your SimpleDialog implementation, i.e. what are you calling and how you are calling it.
Edit: Make sure you have added all required plug-ins: org.apache.cordova.dialogs AND org.apache.cordova.invoke.
Edit #2: the callback not getting invoked has been confirmed as a defect. To receive a fix, please open a PMR.

How can I view all information about my Titanium and Alloy install inside the console

How can I log all system information about Titanium and Alloy configuration and all other information about the current build, version numbers etc?
I'm looking for something similar to PHP's phpinfo.
You can log it using the methods mentioned from #daniula and #Wahhas_mirza. But you can use the command line tools if needed to display information that relates to Alloy and Titanium.
If you open the Terminal Window, enter the keyword alloy, you will then see the usage for the command.
alloy
To view what version of alloy your project is using enter:
alloy -version
For Titanium related information use the keyword ti
ti
which then displays the usage for:
Titanium Command-Line Interface
As an example: ti info will display all relevant information that pertains to your Titanium setup
I hope this helps.
There is nothing like phpinfo() in Titanium. If you really want to print all information about your platform you can try something like this:
for (var i in Titanium.Platform) {
if Titanium.Platform.hasOwnProperty(i) {
Ti.API.info(i + ': ' + Titanium.Platform[i]);
}
}
Start a terminal session in studio ( or switch to app's directory in a console). Type ti info. You'll get output similar to the following
Titanium Command-Line Interface, CLI version 3.2.3, Titanium SDK version 3.2.3.GA
Copyright (c) 2012-2014, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
Operating System
Name = Mac OS X
Version = 10.9.3
Architecture = 64bit
# CPUs = 8
Memory = 8.0GB
Node.js
Node.js Version = 0.10.28
npm Version = 1.4.9
Titanium CLI
CLI Version = 3.2.3
node-appc Version = 0.2.1
Additionally, you'll get a list of all your simulator/emulator configurations, certificates, provisioning profiles and any config errors (if any).
Here you go
Ti.API.info('I want to show the data in console');
Thanks

IBM Worklight - How to resolve "WebWorks SDK source file was not found" error?

I am using Worklight 6 on Windows 7.
I've installed the WebWorks SDK for BlackBerry and also set the environment path for the WebWorks SDK.
When trying to build my application (that has the blackberry10 environment) the following error is shown:
W: WebWorks SDK source file was not found. Make sure to set it in
application-decsriptor.xml: Replace it with path to WebWorks
The path to the BB10 SDK has got nothing to do with application-descriptor.xml file so I don't quite understand why would it complain about it there.
Here is a question with this same error; The problem in this case was about using an incorrect SDK version:
IBM Worklight 6.0 - "WebWorks SDK source file was not found" error
For BlackBerry 6 and 7, use: https://developer.blackberry.com/bbos/html5/downloads/?os=mac#smartphones
For BlackBerry 10, use: https://developer.blackberry.com/html5/downloads/?os=mac#blackberry10
Also note that Worklight does not officially support BB10 WebWorks SDK 2.0 beta.
So make sure to use the previous version (1.0.4.11 - direct download link), perhaps it will help in solving this.
I would also make sure that your WEBWORKS_HOME environment variable indeed points to the correct location; In my - working - setup it points to: C:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK 1.0.4.11

Using WebKit for SWT Browser inside Eclipse plugin

I tried today to use the WebKit as the Browser's underlying renderer for my eclipse plugin but no luck.
I followed the recommended instructions and my current environment is as follows:
OS: Windows 7 (x64)
Safari installed (in the PATH too)
32 bit SWT (eclipse RCP indigo SR1 32)
added the following line to eclipse.ini
-Dorg.eclipse.swt.browser.DefaultType=webkit
Now when I try to instantiate the browser:
Browser b = new Browser(parent, SWT.WEBKIT);
b.setUrl("http://whatismybrowser.com");
I get the following error:
Failed to load the swt-webkit library
Any suggestions?
Thanks.
I got this problem too
What you need to do use
JVM : 32bit
SWT :32 bit
set the safari.exe path in your environment settings , (If you are using older version of Windows)
Else if SWT and JVM are not of same 32 bit it will generate error .