Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16131] Can't launch app on android device with Run option

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-01-07T00:39:59.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, CLI
Labelsandroid
ReporterMarten Nelson
AssigneeShak Hossain
Created2013-12-27T07:57:47.000+0000
Updated2017-03-21T21:55:38.000+0000

Description

See Q&A at http://developer.appcelerator.com/question/160742/cant-run-app-on-android-device-but-debug-works#comment-197873. When I build for an android device using the "Run" option, the app freezes on startup with the background showing. If I build with Debug, it works fine. While this might be considered a workaround, it causes time delays when testing as the debug mode is exited every time the app is closed. Environment: - Ti Studio 3.2 with sdk 3.2.0GA - OSX Maverich - Android 4.1.2 - LG Optimus L9

Attachments

FileDateSize
Ti.build.log2013-12-27T07:57:47.000+0000141739

Comments

  1. Marten Nelson 2014-01-01

    There are more people experiencing the same issue - http://developer.appcelerator.com/question/160742/cant-run-app-on-android-device-but-debug-works#answer-273280
  2. Chris Barber 2014-01-06

    I'm trying to reproduce this using a fresh install of Mac OS X Mavericks with a Samsung Galaxy Nexus with Android 4.0 and a Nexus 7 with Android 4.3. Both work just fine for device builds. I'm going to install Titanium Studio 3.2 and do a few debug/non-debug builds and see if I can reproduce the problem. It really sounds like the problem is that the deploy.json is not removed from the device's SD card. Could you try manually removing it? 1. Connect device 2. Run "adb shell" from command line 3. Run "cd /sdcard" 4. Run "ls" 5. Locate a directory with your app's id 6. Run "cd " 7. Run "ls" 8. If a "deploy.json" file exists, delete it by running "rm deploy.json". If it does not exist, then the app should launch just fine. Can you verify that the deploy.json file does not exist, yet the app still won't launch?
  3. Marten Nelson 2014-01-06

    Right on! That solved it. deploy.json was present. I removed it and launched using the "Run" option and it works.
  4. Chris Barber 2014-01-06

    No way. Crazy. When doing a non-debug build, the build process should remove that file. You can even see it in the log output:
       [INFO] :   Removing deploy.json from SD card
       
    The build script is running the following shell command:
       logger.info(__('Removing %s from SD card', 'deploy.json'.cyan));
       adb.shell(device.id, '[ -f "/sdcard/' + builder.appid + '/deploy.json" ] && rm -f "/sdcard/' + builder.appid + '/deploy.json"\necho "DONE"', cb);
       
    Your app id is sane, so it essentially is running:
       [ -f "/sdcard/com.edtuit.geoperks/deploy.json" ] && rm -f "/sdcard/com.edtuit.geoperks/deploy.json"
       echo "DONE"
       
    For some reason the \-f file exists check is failing \-OR\- the "rm" is failing, but I would put my money on the file exists check. Maybe I should expand this into a full "if" block. In any case, I'm glad it's working now. If you do another debug build, it will add that deploy.json file back. Hopefully in future Titanium versions, we will remove this dependency.
  5. Chris Barber 2014-01-07

    I'm resolving this issue, but have opened TIMOB-16132 to remove the deploy.json to prevent these sort of issues in the future.
  6. Adeel Javed 2014-04-21

    I have facing this issue from last 1 week on android device. But here it is mention that this not reproduce. The Scenario is same as mention in the ticket's description. Environment: Ti Studio 3.2.1 with sdk 3.2.0GA or latest. OSX 10.8.4 Galaxy Nexus. Can anyone help me out with this issue.
  7. luca capra 2014-04-21

    This happened to me too, suggestion above works.
       adb shell 
       rm sdcard/<app id>/deploy.json
       
    ubuntu 13.10 64 sdk 3.2.2.GA samsung s3 4.1.2
  8. Chris Barber 2014-05-06

    FYI, in Titanium SDK 3.3.0, we no longer store the deploy.json on the sd card. We store it in the APK file, so you cannot accidentally run into a situation where you are testing a non-debug build with a debug deploy.json.
  9. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source