Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16215] CLI: Android: Show error and abort build if app name contains an ampersand

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-03-25T23:03:43.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2014 Sprint 03, 2014 Sprint 03 Core, Release 3.2.3, Release 3.3.0
ComponentsAndroid, CLI
Labelsqe-closed-3.2.3, qe-testadded
ReporterChris Barber
AssigneeChris Barber
Created2014-01-17T01:54:45.000+0000
Updated2016-02-25T21:51:23.000+0000

Description

If you try to build an app that has an ampersand in the app name, then the build completes, but adb is unable to install the app to the emulator/device.
[INFO]  Installing apk: /Users/chris/appc/workspace/testapp2/build/android/bin/testapp2 & blah.apk
[ERROR] Failed to install apk on "192.168.56.101:5555"
[ERROR] Error: INSTALL_FAILED_INVALID_URI
The solution is to simply disallow ampersands in the app name. When creating a new app, only allow ampersands in the name if Android is NOT selected, however do show an warning.

Comments

  1. Chris Barber 2014-01-31

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5299 3.2.x pull request: https://github.com/appcelerator/titanium_mobile/pull/5300
  2. Chris Barber 2014-03-25

    Resolving again as this is the intended behavior.
  3. Priya Agarwal 2014-03-26

    Verified the fix with test Environment: Appc Studio:3.2.3.201403250634 Sdk:3.2.3.v20140325145222 alloy:1.3.1 titanium:3.2.3-dev titanium-code-processor:1.1.0 Osx: Maverick(10.9.2) Device:LG-P970(V4.0.4),IpodToch2(v7.1) Steps followed to test: Scenario 1: Tried creating new classic and alloy app having "&" in project name example(android&test) and target as android. Result: As expected was not able to create Project having "&" in project name. Scenario 2: However Tried creating new classic and alloy app having "&" in project name example(android&test) and target as ios. Result: As expected was able to successfully create and install app on ios device having "&" in project name. Scenario 3: Edited tiapp.xml and added target as android also on the above created app and tried running it on android device. Result: As expected Got the expected error as:
       [ERROR] :  The app name "android&test" contains an ampersand (&) which will most likely cause problems.
       [ERROR] :  It is recommended that you define the app name using i18n strings.
       [ERROR] :  Refer to http://appcelerator.com/i18n-app-name for more information.
       [ERROR] :  To allow ampersands in the app name, run:
       [ERROR] :  ti config android.allowAppNameAmpersands true
       [ERROR] Application Installer abnormal process termination. Process exit value was 1
       
    Scenario 4:Edited tiapp.xml and added target as android. Also added "ti config android.allowAppNameAmpersands true" in CLI. Then tried running it on android device. Result: Build was successful with message give below as warnings but still was not able to install apk on android device as expected.
       [WARN] :   The app name "android&test" contains an ampersand (&) which will most likely cause problems.
       [WARN] :   It is recommended that you define the app name using i18n strings.
       [WARN] :   Refer to http://appcelerator.com/i18n-app-name for more information.
       
  4. Joseph Sachs 2016-02-25

    Another solution (if ampersand is not in the name), is to delete from the Android device (or simulator) the previously installed version.

JSON Source