Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9666] Android: Application doesn't work with Fastdev enabled

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2012-07-05T03:39:11.000+0000
Affected Version/sRelease 2.0.2, Release 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-13 Core
ComponentsAndroid
Labelscore, module_imageview, qe-testadded, regression
ReporterNikhil Sharma
AssigneeJosh Roesslein
Created2012-06-20T14:23:49.000+0000
Updated2012-07-05T14:31:21.000+0000

Description

The application doesn't run on the emulator with fastdev enabled. It only works if the fastdev is disabled. I'm attaching the error logs. Please send me an e-mail if you need the source code. To reproduce this issue here's a test case. The bug occurs when you set the "image" property of an ImageView to an empty string or a path that points to a directory.
var win = Ti.UI.createWindow();
win.add(Ti.UI.createImageView({
  image: ""
}));
win.open();

Attachments

FileDateSize
error_log.rtf2012-06-20T14:23:49.000+000016672

Comments

  1. Josh Roesslein 2012-06-20

    This is caused by an exception in the fastdev server:
       Exception happened during processing of request from ('127.0.0.1', 63348)
       Traceback (most recent call last):
         File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 582, in process_request_thread
           self.finish_request(request, client_address)
         File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
           self.RequestHandlerClass(request, client_address, self)
         File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 639, in __init__
           self.handle()
         File "/Users/jroesslein/Development/Appcelerator/titanium_mobile/support/android/fastdev.py", line 170, in handle
           self.handle_get(tokens[1])
         File "/Users/jroesslein/Development/Appcelerator/titanium_mobile/support/android/fastdev.py", line 226, in handle_get
           self.send_file(path)
         File "/Users/jroesslein/Development/Appcelerator/titanium_mobile/support/android/fastdev.py", line 238, in send_file
           buffer = open(path, mode).read()
       IOError: [Errno 21] Is a directory: '/Users/<user>/Desktop/<app>/Resources/<app>/ui/'
       
  2. Josh Roesslein 2012-06-20

    Created [PR #2445](https://github.com/appcelerator/titanium_mobile/pull/2445) to resolve issue. Test by running the simplified test case above. Before the fix you should get a crash similar to the one being reported in the error_log.rtf file. Apply the fix then run the application again. There should be no more crash. Try various values for the "image" property such as a directory path or a string with just whitespace.
  3. Tamila Smolich 2012-06-23

    Closing as fixed. Verified with: Titanium Studio, build: 2.1.0.201206221045 Titanium SDK: 2.1.0.v20120622174154 Device: Samsung Galaxy tab (3.2)
  4. Shyam Bhadauria 2012-07-05

    Re-opening to edit the label.

JSON Source