Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8507] Android: density specific resolution images for launcher icon are not used

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-01-22T00:27:14.000+0000
Affected Version/sRelease 1.7.6, Release 1.8.2, Release 2.1.3, Release 1.8.3
Fix Version/s2013 Sprint 02 API, 2013 Sprint 02
ComponentsAndroid
LabelsSupportTeam, api
ReporterFederico Casali
AssigneePing Wang
Created2012-04-03T13:56:44.000+0000
Updated2017-03-31T20:50:00.000+0000

Description

Problem description

Density specific launcher icons are not used. Icons included in platform/res/drawable-/ folders are not used.

Steps to reproduce

As described in https://wiki.appcelerator.org/display/guides/Using+density-specific+resources+on+Android#Usingdensity-specificresourcesonAndroid-Theappicon , folders for specific icons resolutions are created. Different versions of myAppicon.png file is put inside each folder, however only the file icon specified in TiAPP.xml (/path-to-icon/myAppicon.png) is actually used. Other versions (set with the same name) inside res/drawable folder are ignored. Same result if using the default appicon.png filename

Additional notes

Customer ticket link: http://support-admin.appcelerator.com/display/APP-536715

Attachments

FileDateSize
timob8507.zip2013-01-22T00:26:36.000+00003834070

Comments

  1. Shawn Lipscomb 2012-04-04

    HD ticket: http://support.appcelerator.com/tickets/APP-536715
  2. Shawn Lipscomb 2012-04-11

    The filename (other than appicon.png) listed in the section of TiApp.xml isn't being carried into the AndroidManifest.xml file. I'd rather not name all of my apps' launcher icons "appicon.png"...that would get hard to manage with multiple apps.
  3. Shawn Lipscomb 2012-09-13

    Still a problem in SDK 2.1.0.GA.
  4. Jon Barnhart 2012-09-13

    I just ran into this issue. I have all my launcher icons setup in the platform directory, but Titanium is still requiring that the launcher icon ALSO exists in the /Resources/Android/ directory as well.
  5. Shawn Lipscomb 2012-09-28

    Ping, please take a look at the detail in the HD ticket referenced above.. Part of this problem is that the actual icon name listed in TiApp.xml is not carried over to the android:icon section of AndroidManifest.xml.
  6. Ping Wang 2013-01-22

    Based on the [doc](http://docs.appcelerator.com/titanium/3.0/#!/guide/Icons_and_Splash_Screens-section-29004897_IconsandSplashScreens-Icons%2Csplashscreens%2Candstorerequirements), the density-specific Android icons should be put inside platform/res/drawable-/ folders and the file name has to be *appicon.png*. Tested with latest master and 3.0 branch. The density-specific icons work fine. Attached a test project "timob8507".
  7. Shawn Lipscomb 2013-01-22

    Ping, in your zip file, you still have appicon.png *also* listed under the Resources/android/ directory. See Jon Barnhart's comment above about Titanium requiring it. Under what circumstances does that copy of the icon get used?
  8. Ping Wang 2013-01-22

    Shawn, I deleted the /Resources/android/image/appicon.png file and the attached project still works fine. When we build the project, we will always check whether /platform/res/drawable/*appicon.png* exists or not. If it does not exist, we will try to copy /Resources/android/image/appicon.png to /platform/res/drawable/. In this situation, the /Resources/android/image/appicon.png is used.
  9. Shawn Lipscomb 2013-01-22

    Ping, thanks for clarifying. > When we build the project, we will always check > whether /platform/res/drawable/appicon.png exists or not. Does that go for any of the /platform/res/drawable-/ directories, or just /platform/res/drawable/ specifically? I have \platform\android\res\drawable-hdpi, \platform\android\res\drawable-mdpi, and \platform\android\res\drawable-xhdpi directories, but no plain \platform\res\drawable\ directory. I just tried to do a clean build of a project and got this error in the Application Installer console window: {panel}
       IOError: [Errno 2] No such file or directory: u'C:\\Titanium\\blablaWorkspace\\blablaProject\\build\\android\\bin\\assets\\Resources\\appicon.png'
       
    {panel} I'm using Windows 7. I have appicon.png in these locations only: \platform\android\res\drawable-mdpi\appicon.png \platform\android\res\drawable-hdpi\appicon.png \platform\android\res\drawable-xhdpi\appicon.png So something is still wrong. I have to throw a copy of the appicon.png file into this location to get it to build: /Resources/android/appicon.png
  10. Ping Wang 2013-01-22

    Shawn, we only check for /platform/res/*drawable*/ directory. In your case, since you don't have /platform/res/drawable/appicon.png, we will try to copy it from /Resources/android/. And since there is no /Resources/android/appicon.png, it throws the error as you described.
  11. Shawn Lipscomb 2013-01-22

    OK, got it. I just tested and throwing the extra copy in /platform/res/drawable/ makes it happy. However, I still have two points: 1. That's still an extra copy of the icon that will never be used. 2. The only reason I have for the /platform/res/drawable-/ directories is for the launcher icons. Every other density-specific image is handled by the /Resources/android/images/low|medium|high|res-xhdpi/ directory structure. It would be nice if Titanium would look in those (the latter) directories for the launcher icons also.
  12. Lee Morris 2017-03-31

    Unable to reproduce this issue, tested with the following environment; Pixel (7.1) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.2 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80

JSON Source