Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5235] Project cannot reinstall after build folder is cleaned

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2011-09-11T13:34:14.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-36, Release 1.8.0
ComponentsAndroid
Labelsandroid, emulator, install, tistudio
ReporterAlan Vaghti
AssigneeMarshall Culpepper
Created2011-08-11T14:37:32.000+0000
Updated2011-09-12T16:54:04.000+0000

Description

1) Create an Android project and run it in the emulator. 2) After the project has successfully installed on the emulator, close the emulator. 3) Clean the project (either through Project -> Clean... or by deleting the build files manually in the project file: Titanium Studio Workspace\\build\android\) 4) Run the project in the emulator again Expected: Project installs normally and autolaunches in emulator Actual: Project never reinstalls in emulator. If you look in Debug perspective, the Application Installer exit value is 1 instead of the expected 0 Notes: - Happens regardless of Fastdev being on or off. - Reproducible in build 1.0.2.201107130739 Workaround: Exit and relaunch TiStudio. Application will now properly install on emulator.

Attachments

FileDateSize
log.txt2011-08-11T14:41:07.000+00005750

Comments

  1. Ingo Muschenetz 2011-08-11

    Max, thoughts? Might be for Marshall.
  2. Max Stepanov 2011-08-11

    probably ours since TiStudio restart resolves. will try to reproduce
  3. Max Stepanov 2011-08-11

    The issue here is that FastDev server is running when users cleans the project. The right approach would be to terminate FastDev server when Clean action is triggered. Workaround: open Debug view, select FastDev server for the project and click Terminate button.
  4. Alan Vaghti 2011-08-11

    Should have added this in the steps, but the original problem still occurred when we terminated the Fastdev server in Debug View and pressed Remove all Terminated Launches. We did this before we cleaned the project build.
  5. Max Stepanov 2011-08-11

    NPE found in attached log is fixed.
  6. Max Stepanov 2011-08-11

    Application Installer console output:
       [INFO] Compiling Javascript Resources ...
       [DEBUG] Processing Android resource drawables
       [DEBUG] Detecting modules in /Users/max/Documents/Titanium Studio Workspace/debug test/modules
       [DEBUG] Detecting modules in /Library/Application Support/Titanium/modules
       [DEBUG] app stylesheet => /Users/max/Documents/Titanium Studio Workspace/debug test/build/android/gen/com/appcelerator/testdebug/ApplicationStylesheet.java
       [DEBUG] copying app icon: /Users/max/Documents/Titanium Studio Workspace/debug test/build/android/bin/assets/Resources/appicon.png
       [ERROR] Exception occured while building Android project:
       [ERROR] Traceback (most recent call last):
       [ERROR]   File "/Library/Application Support/Titanium/mobilesdk/osx/1.7.0/android/builder.py", line 1947, in <module>
       [ERROR]     s.build_and_run(False, avd_id, debugger_host=debugger_host)
       [ERROR]   File "/Library/Application Support/Titanium/mobilesdk/osx/1.7.0/android/builder.py", line 1740, in build_and_run
       [ERROR]     self.manifest_changed = self.generate_android_manifest(compiler)
       [ERROR]   File "/Library/Application Support/Titanium/mobilesdk/osx/1.7.0/android/builder.py", line 811, in generate_android_manifest
       [ERROR]     shutil.copy(iconpath, dest_icon)
       [ERROR]   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/shutil.py", line 88, in copy
       [ERROR]     copyfile(src, dst)
       [ERROR]   File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/shutil.py", line 52, in copyfile
       [ERROR]     fsrc = open(src, 'rb')
       [ERROR] IOError: [Errno 2] No such file or directory: u'/Users/max/Documents/Titanium Studio Workspace/debug test/build/android/bin/assets/Resources/appicon.png'
       
  7. Max Stepanov 2011-08-11

    Hi Alan, Does the workaround you mentioned "Exit and relaunch TiStudio. Application will now properly install on emulator." really work for you ? Once I reproduced the issue, I could not get rid of it even after restart. Even more: the error does not go any even after TiSDK change from 1.7.1 to 1.7.2
  8. Max Stepanov 2011-08-11

    Marshall, ideas ?
  9. Alan Vaghti 2011-08-12

    Hi Max, Interesting, I went through the steps again and the application successfully installs after I close the emulator and studio, relaunch studio, and rerun the application on the emulator. I never changed SDK versions though. I was always using SDK 1.7.2.
  10. Max Stepanov 2011-08-12

    Alan, Marshall, this is definitely TiSDK issue. The reason why TiStudio restart helps is because tiapp.xml timestamp changes on restart. probably by project builder on start.
  11. Ingo Muschenetz 2011-08-17

    Move this into 1.1
  12. Marshall Culpepper 2011-08-21

    Hey Max, I took a look at the code where this error occurs, and it looks like we're already preemptively creating the build/android/bin/assets/Resources directory just a few lines above. Is the "Clean" process implemented in TiStudio happening asynchronously somehow, causing the folder to get deleted behind the script after it's created?
  13. Max Stepanov 2011-08-21

    Nope. I reproduced this sitting with Alan side-by-side. It has nothing to do with Clean process. Deleting build/android folder via Windows explorer has the same effect. Basically the issue is: only touching tiapp.xml forces full rebuild.
  14. Marshall Culpepper 2011-08-22

    Have you been able to reproduce this anywhere besides Windows? I've deleted the build/android folder several times in a row without touching tiapp.xml, and I'm not seeing any builder.py errors here.
  15. Max Stepanov 2011-08-22

    Yep, I got my output above from OSX. One thing we noticed on the build output is that only full rebuild log contains something like "Copying Resources/android/appicon.png to build/android/bin/assets/Resources/appicon.png" and same message for default.png. The other build after removing build/android did not contain these messages.
  16. Thomas Huelbert 2011-09-08

    See the community ticket - http://developer.appcelerator.com/question/123898/android-gives-error-on-file-readtext "I have the same problem. After downloading and using mobile sdk build mobilesdk-1.7.3.v20110826161351 fromhttp://builds.appcelerator.com.s3.amazonaws.com/index.html, the problem is resolved. I'm running Mac OS X."
  17. Natalie Huynh 2011-09-12

    Duplicate of TIMOB-5040

JSON Source