Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25284] Android Images in density-specific resource folders are not picked

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-09-21T21:09:41.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.2
ComponentsAndroid
Labels6.2.0, android, density-specific, regression
ReporterDavid van de Meer
AssigneeJoshua Quick
Created2017-09-14T10:20:32.000+0000
Updated2018-08-30T02:22:24.000+0000

Description

density-specific resourced in 6.2.0 are not working - images in for example res-hdpi are not picked up. Images in the android/images folder work fine but in for example android/images/res-hdpi they are not picked up and I receive this error. When I build the same exact files in 6.1.2 it works fine Example of file structure: app/assets/android/images/res-hdpi/menu_home.png
ERROR] :  TiDrawableReference: (pool-10-thread-1) [948,948] Problem opening stream with url /images/menu_home.png: Resources/images/menu_home.png
[ERROR] :  TiDrawableReference: java.io.FileNotFoundException: Resources/images/menu_home.png
[ERROR] :  TiDrawableReference: 	at android.content.res.AssetManager.openAsset(Native Method)
[ERROR] :  TiDrawableReference: 	at android.content.res.AssetManager.open(AssetManager.java:313)
[ERROR] :  TiDrawableReference: 	at android.content.res.AssetManager.open(AssetManager.java:287)
[ERROR] :  TiDrawableReference: 	at org.appcelerator.titanium.util.TiFileHelper.openInputStream(TiFileHelper.java:222)
[ERROR] :  TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getInputStream(TiDrawableReference.java:863)
[ERROR] :  TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:319)
[ERROR] :  TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:303)
[ERROR] :  TiDrawableReference: 	at org.appcelerator.titanium.util.TiLoadImageManager$LoadImageJob.run(TiLoadImageManager.java:128)
[ERROR] :  TiDrawableReference: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
[ERROR] :  TiDrawableReference: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
[ERROR] :  TiDrawableReference: 	at java.lang.Thread.run(Thread.java:818)

Comments

  1. Lokesh Choudhary 2017-09-14

    Verified the issue is reproducible with images in density specific folders.
       [ERROR] :  [Pixel] TiDrawableReference: (pool-3-thread-1) [104,610] Problem opening stream with url mario.png: Resources/mario.png
       [ERROR] :  [Pixel] TiDrawableReference: java.io.FileNotFoundException: Resources/mario.png
       [ERROR] :  [Pixel] TiDrawableReference: 	at android.content.res.AssetManager.openAsset(Native Method)
       [ERROR] :  [Pixel] TiDrawableReference: 	at android.content.res.AssetManager.open(AssetManager.java:347)
       [ERROR] :  [Pixel] TiDrawableReference: 	at android.content.res.AssetManager.open(AssetManager.java:321)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.util.TiFileHelper.openInputStream(TiFileHelper.java:222)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getInputStream(TiDrawableReference.java:863)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:346)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:303)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.util.TiLoadImageManager$LoadImageJob.run(TiLoadImageManager.java:128)
       [ERROR] :  [Pixel] TiDrawableReference: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
       [ERROR] :  [Pixel] TiDrawableReference: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       [ERROR] :  [Pixel] TiDrawableReference: 	at java.lang.Thread.run(Thread.java:761)
       [WARN] :   [Pixel] TiDrawableReference: (pool-3-thread-1) [3,613] Could not open stream to get bitmap
       
       [ERROR] :  [Pixel] TiDrawableReference: (pool-3-thread-1) [103,601] Problem opening stream with url /images/mario.png: Resources/images/mario.png
       [ERROR] :  [Pixel] TiDrawableReference: java.io.FileNotFoundException: Resources/images/mario.png
       [ERROR] :  [Pixel] TiDrawableReference: 	at android.content.res.AssetManager.openAsset(Native Method)
       [ERROR] :  [Pixel] TiDrawableReference: 	at android.content.res.AssetManager.open(AssetManager.java:347)
       [ERROR] :  [Pixel] TiDrawableReference: 	at android.content.res.AssetManager.open(AssetManager.java:321)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.util.TiFileHelper.openInputStream(TiFileHelper.java:222)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getInputStream(TiDrawableReference.java:863)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:346)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:303)
       [ERROR] :  [Pixel] TiDrawableReference: 	at org.appcelerator.titanium.util.TiLoadImageManager$LoadImageJob.run(TiLoadImageManager.java:128)
       [ERROR] :  [Pixel] TiDrawableReference: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
       [ERROR] :  [Pixel] TiDrawableReference: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       [ERROR] :  [Pixel] TiDrawableReference: 	at java.lang.Thread.run(Thread.java:761)
       [WARN] :   [Pixel] TiDrawableReference: (pool-3-thread-1) [2,603] Could not open stream to get bitmap
       
    Studio Ver: 4.9.1.201707200100 SDK Ver: 6.2.0.GA OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.4 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.14 Node Ver: 6.11.2 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 --- Android 6.0.1 ⇨ google Pixel --- Android 7.1.1
  2. Joshua Quick 2017-09-15

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9434 PR (6.3.x): https://github.com/appcelerator/titanium_mobile/pull/9436 PR (6.2.x): https://github.com/appcelerator/titanium_mobile/pull/9435
  3. Lokesh Choudhary 2017-09-15

    FR passed for all PR's. PR's merged.
  4. Lokesh Choudhary 2017-09-18

    Verified the fix in SDK 6.2.1.v20170915135328. For steps please refer PR. Studio Ver: 4.9.1.201707200100 SDK Ver: 6.2.1.v20170915135328 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.4 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.14 Node Ver: 7.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Pixel --- Android 7.1.1 ⇨ google Nexus 5 --- Android 6.0.1
  5. Eric Merriman 2017-09-19

    Reopening to change versions

JSON Source