[TIMOB-25284] Android Images in density-specific resource folders are not picked
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-09-21T21:09:41.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.2.2 |
Components | Android |
Labels | 6.2.0, android, density-specific, regression |
Reporter | David van de Meer |
Assignee | Joshua Quick |
Created | 2017-09-14T10:20:32.000+0000 |
Updated | 2018-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)
Verified the issue is reproducible with images in density specific folders.
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
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
FR passed for all PR's. PR's merged.
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
Reopening to change versions