Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2722] Android: Ti.Imagefactory Example errors when pressing next

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionDone
Resolution Date2021-02-05T11:44:06.000+0000
Affected Version/sRelease 9.1.0
Fix Version/sn/a
ComponentsImageFactory
LabelsAndroid
ReporterSamir Mohammed
AssigneeSatinder Pal Singh
Created2020-07-21T15:34:42.000+0000
Updated2021-02-05T15:54:15.000+0000

Description

When running the example in Ti.IMagefactory the following error is shown when pressing Next.
[ERROR] TiAssetHelper: Error while opening asset "Resources/images/flower.jpg.keep":
[ERROR] TiAssetHelper: java.io.FileNotFoundException: Resources/images/flower.jpg.keep
[ERROR] TiAssetHelper: 	at android.content.res.AssetManager.nativeOpenAsset(Native Method)
[ERROR] TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:874)
[ERROR] TiAssetHelper: 	at android.content.res.AssetManager.open(AssetManager.java:851)
[ERROR] TiAssetHelper: 	at org.appcelerator.kroll.util.KrollAssetHelper.openAsset(KrollAssetHelper.java:140)
[ERROR] TiAssetHelper: 	at org.appcelerator.titanium.io.TiResourceFile.getInputStream(TiResourceFile.java:71)
[ERROR] TiAssetHelper: 	at org.appcelerator.titanium.TiBlob.getInputStream(TiBlob.java:359)
[ERROR] TiAssetHelper: 	at org.appcelerator.titanium.view.TiDrawableReference.getInputStream(TiDrawableReference.java:866)
[ERROR] TiAssetHelper: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:344)
[ERROR] TiAssetHelper: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:328)
[ERROR] TiAssetHelper: 	at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:312)
[ERROR] TiAssetHelper: 	at ti.imagefactory.ImageFactoryModule.imageTransform(ImageFactoryModule.java:150)
[ERROR] TiAssetHelper: 	at ti.imagefactory.ImageFactoryModule.imageWithAlpha(ImageFactoryModule.java:184)
[ERROR] TiAssetHelper: 	at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[ERROR] TiAssetHelper: 	at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63)
[ERROR] TiAssetHelper: 	at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:977)
[ERROR] TiAssetHelper: 	at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1206)
[ERROR] TiAssetHelper: 	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:262)
[ERROR] TiAssetHelper: 	at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] TiAssetHelper: 	at android.os.Looper.loop(Looper.java:223)
[ERROR] TiAssetHelper: 	at android.app.ActivityThread.main(ActivityThread.java:7523)
[ERROR] TiAssetHelper: 	at java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiAssetHelper: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
[ERROR] TiAssetHelper: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
[WARN]   TiDrawableReference: (main) [18165,18999] Could not open stream to get bitmap
[WARN]   TiDrawableReference: (main) [0,18999] Could not open stream to get bitmap
[ERROR] TiExceptionHandler: (main) [3,19002] /app.js:75
[ERROR] TiExceptionHandler:   imageViewTransformed.size = { width: newBlob.width, height: newBlob.height };
[ERROR] TiExceptionHandler:                                                ^
[ERROR] TiExceptionHandler: TypeError: Cannot read property 'width' of null
[ERROR] TiExceptionHandler:     at Button.<anonymous> (/app.js:75:48)
[ERROR] TiExceptionHandler:     at Button.value (ti:/events.js:50:21)
[ERROR] TiExceptionHandler:     at Button.value (ti:/events.js:102:19)
[ERROR] TiExceptionHandler:
[ERROR] TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
[ERROR] TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63)
[ERROR] TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:977)
[ERROR] TiExceptionHandler:     org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1206)
[ERROR] TiExceptionHandler:     org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:262)
[ERROR] TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] TiExceptionHandler:     android.os.Looper.loop(Looper.java:223)
[ERROR] TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:7523)
[ERROR] TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiExceptionHandler:     com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
[ERROR] V8Exception: Exception occurred at /app.js:75: Uncaught TypeError: Cannot read property 'width' of null
*Test Steps:*

Download the source for ti,imagefactroy (https://github.com/appcelerator-modules/ti.imagefactory)

Open the Terminal.

CD to the ./ti.imagefactory/android folder.

Enter: appc run -p android

Verify that the module successfully builds and runs

Press next when once the Test app launches

*Actual result* Above error is shown *Expected result* App should show the next image without an error.

Comments

  1. Satinder Pal Singh 2021-02-05

    [~smohammed], I'm not able to re-produce this issue on android emulator (may be with new releases & update it get fixed but I'm not able to track the exact commit where it got fixed). Can you re-verify once again. MacOS Catalina : 10.15.7 Xcode: 12.0 Node.js: 12.15.1 NPM:6.13.4 CLI:5.2.5 Min SDK: 9.0.0 SDK Selected: 9.2.1.GA Pixel_3_API_30 emulator
  2. Samir Mohammed 2021-02-05

    Closing ticket, issue has now been resolved. No longer get the comment mentioned in the description. [~ssingh] Looks like this issue was fixed in the following commit: https://github.com/appcelerator-modules/ti.imagefactory/commit/b13c162db8c774c76b5a6f3436bdfe3ad2b8f7ec

JSON Source