[TIMOB-26580] Android: ListView templates not compatible with native modules
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-01-08T19:04:59.000+0000 |
| Affected Version/s | Release 7.5.0 |
| Fix Version/s | Release 8.0.0, Release 7.5.1 |
| Components | Android |
| Labels | n/a |
| Reporter | Gary Mathews |
| Assignee | Gary Mathews |
| Created | 2018-11-16T22:42:12.000+0000 |
| Updated | 2019-01-09T20:51:26.000+0000 |
Description
ListView templates have a bug that prevents support for native modules.
var template = {
childTemplates: [
{
type: '<native-module-namespace>,
bindId: '',
properties: { ... }
}
]
};
master: https://github.com/appcelerator/titanium_mobile/pull/10479
FR Passed. PR Merged.
7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10509
still having this problem after test with the latest SDK 7.5.1.v20181204143821 [ERROR] : TiExceptionHandler: (main) [2537,4852] ti:/listview.js:54 [ERROR] : TiExceptionHandler: childProxy = creationFunction(creationProperties); [ERROR] : TiExceptionHandler: ^ [ERROR] : TiExceptionHandler: TypeError: creationFunction is not a function [ERROR] : TiExceptionHandler: at processChildTemplates (ti:/listview.js:54:19) [ERROR] : TiExceptionHandler: at processChildTemplates (ti:/listview.js:65:4) [ERROR] : TiExceptionHandler: at UI.createListView (ti:/listview.js:20:6) [ERROR] : TiExceptionHandler: at UIWrapper.invoker [as createListView] (ti:/invoker.js:101:19) [ERROR] : TiExceptionHandler: at new Controller (eval at Module._compile (app://app.js:728:13),
Reopening. I am able to reproduce the error in the above comment.
master: https://github.com/appcelerator/titanium_mobile/pull/10517
FR Passed for master. PR for master merged. Waiting for backport.
7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10526
FR passed & merged for backport.
Verified the fix in SDK 7.5.1.v20181210141225 & 8.0.0.v20181210140414. Closing.
For me it is fixed in 7.5.1.v20181210141225 (7.5.1.RC) but with 8.0.0.v20181214080710 (latest 8 at the moment) I'll end up with this error again:
using[ERROR] TiExceptionHandler: (main) [1754,1754] ti:/listview.js:60 [ERROR] TiExceptionHandler: childProxy = creationFunction(creationProperties); [ERROR] TiExceptionHandler: ^ [ERROR] TiExceptionHandler: TypeError: creationFunction is not a function [ERROR] TiExceptionHandler: at processChildTemplates (ti:/listview.js:60:19) [ERROR] TiExceptionHandler: at UI.createListView (ti:/listview.js:22:6) [ERROR] TiExceptionHandler: at UIWrapper.invoker [as createListView] (ti:/invoker.js:105:19) [ERROR] TiExceptionHandler: at new Controller (/alloy/controllers/friends.js:528:8796) [ERROR] TiExceptionHandler: at Object.exports.createController (/alloy.js:339:8) [ERROR] TiExceptionHandler: at new Controller (/alloy/controllers/main.js:846:25529) [ERROR] TiExceptionHandler: at Object.exports.createController (/alloy.js:339:8) [ERROR] TiExceptionHandler: at new Controller (/alloy/controllers/index.js:330:1887) [ERROR] TiExceptionHandler: at Object.exports.createController (/alloy.js:339:8) [ERROR] TiExceptionHandler: at /app.js:148:7 [ERROR] TiExceptionHandler: [ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) [ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:162) [ERROR] TiExceptionHandler: org.appcelerator.kroll.KrollRuntime.runModule(KrollRuntime.java:207) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:135) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:190) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:185) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:780) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:176) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:174) [ERROR] TiExceptionHandler: android.app.Activity.performCreate(Activity.java:6673) [ERROR] V8Exception: Exception occurred at ti:/listview.js:60: Uncaught TypeError: creationFunction is not a function<ImageView bindId="image" class="profil_img" ns="AvImageview"/>inside a ListViewWith 8.0.0.v20181030074154:
7.5.1.v20181210141225 still works fine.[ERROR] TiExceptionHandler: (main) [1525,1525] ti:/module.js:303 [ERROR] TiExceptionHandler: throw new Error('Requested module not found: ' + request); // TODO Set 'code' property to 'MODULE_NOT_FOUND' to match Node? [ERROR] TiExceptionHandler: ^ [ERROR] TiExceptionHandler: Error: Requested module not found: /alloy/widgets/AvImageview.ImageView/controllers/widget [ERROR] TiExceptionHandler: at Module.require (ti:/module.js:303:8) [ERROR] TiExceptionHandler: at lookup (ti:/listview.js:98:29) [ERROR] TiExceptionHandler: at processChildTemplates (ti:/listview.js:50:28) [ERROR] TiExceptionHandler: at UI.createListView (ti:/listview.js:20:6) [ERROR] TiExceptionHandler: at UIWrapper.invoker [as createListView] (ti:/invoker.js:101:19) [ERROR] TiExceptionHandler: at new Controller (/alloy/controllers/friends.js:528:8822) [ERROR] TiExceptionHandler: at Object.exports.createController (/alloy.js:339:8) [ERROR] TiExceptionHandler: at new Controller (/alloy/controllers/main.js:910:26869) [ERROR] TiExceptionHandler: at Object.exports.createController (/alloy.js:339:8) [ERROR] TiExceptionHandler: at new Controller (/alloy/controllers/index.js:330:1924) [ERROR] TiExceptionHandler: [ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) [ERROR] TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:162) [ERROR] TiExceptionHandler: org.appcelerator.kroll.KrollRuntime.runModule(KrollRuntime.java:247) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.loadActivityScript(TiLaunchActivity.java:135) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.windowCreated(TiLaunchActivity.java:190) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.windowCreated(TiRootActivity.java:175) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:676) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:176) [ERROR] TiExceptionHandler: org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:164) [ERROR] TiExceptionHandler: android.app.Activity.performCreate(Activity.java:6673) [ERROR] V8Exception: Exception occurred at ti:/module.js:303: Uncaught Error: Requested module not found: /alloy/widgets/AvImageview.ImageView/controllers/widget[~michael], I am not able to reproduce it. I tried it using the SDK above & also with the latest 8.0.0 SDK. My index.xml below:
<Alloy> <Window> <ListView defaultItemTemplate="custom"> <Templates> <ItemTemplate name="custom"> <ImageView bindId="image" class="profil_img" ns="AvImageview"/> </ItemTemplate> </Templates> <ListSection> <ListItem></ListItem> </ListSection> </ListView> </Window> </Alloy>Oh, I'm sorry. I didn't pay attention to the numbers after I've download the SDK from the build server! It threw me back to October after some seconds. But with 8.0.0.v20181214080710 I still have the error when extending your example to a custom view module (ti.animation in my case). Again, fine with 7.5.1.v20181210141225, broken in 8.0.0.v20181214080710 (the creationFunction error). Full example: https://migaweb.de/listview_test.zip with all modules.
[~michael], I can reproduce the issue it with
ti.animation& latest 8.0.0 SDK. I will reopen the ticket for now.Reopening for now as the issue is seen with
ti.animation.master: https://github.com/appcelerator/titanium_mobile/pull/10577
FR Passed. Waiting for merge to be ready.
Master PR merged.
8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10586