Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26580] Android: ListView templates not compatible with native modules

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-01-08T19:04:59.000+0000
Affected Version/sRelease 7.5.0
Fix Version/sRelease 8.0.0, Release 7.5.1
ComponentsAndroid
Labelsn/a
ReporterGary Mathews
AssigneeGary Mathews
Created2018-11-16T22:42:12.000+0000
Updated2019-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: { ... }
        }
    ]
};

Comments

  1. Gary Mathews 2018-11-16

    master: https://github.com/appcelerator/titanium_mobile/pull/10479
  2. Lokesh Choudhary 2018-11-28

    FR Passed. PR Merged.
  3. Gary Mathews 2018-12-04

    7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10509
  4. Ahmed Mohamed 2018-12-05

    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), :121:1415) [ERROR] : TiExceptionHandler: at Object.exports.createController (eval at Module._compile (app://app.js:728:13), :341:9) [ERROR] : TiExceptionHandler: at View.getBrandCollection (eval at Module._compile (app://app.js:728:13), :308:18) [ERROR] : TiExceptionHandler: at View.value (ti:/events.js:49:21) [ERROR] : TiExceptionHandler: at View.value (ti:/events.js:101: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:971) [ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1196) [ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:401) [ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiExceptionHandler: android.os.Looper.loop(Looper.java:164) [ERROR] : TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:6494) [ERROR] : TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiExceptionHandler: com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) [ERROR] : V8Exception: Exception occurred at ti:/listview.js:54: Uncaught TypeError: creationFunction is not a function
  5. Lokesh Choudhary 2018-12-06

    Reopening. I am able to reproduce the error in the above comment.
  6. Gary Mathews 2018-12-07

    master: https://github.com/appcelerator/titanium_mobile/pull/10517
  7. Lokesh Choudhary 2018-12-10

    FR Passed for master. PR for master merged. Waiting for backport.
  8. Gary Mathews 2018-12-10

    7_5_X: https://github.com/appcelerator/titanium_mobile/pull/10526
  9. Lokesh Choudhary 2018-12-10

    FR passed & merged for backport.
  10. Lokesh Choudhary 2018-12-10

    Verified the fix in SDK 7.5.1.v20181210141225 & 8.0.0.v20181210140414. Closing.
  11. Michael Gangolf 2018-12-16

    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:
        [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
        
    using <ImageView bindId="image" class="profil_img" ns="AvImageview"/> inside a ListView
  12. Michael Gangolf 2019-01-02

    With 8.0.0.v20181030074154:
        [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
        
    7.5.1.v20181210141225 still works fine.
  13. Lokesh Choudhary 2019-01-02

    [~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>
        
  14. Michael Gangolf 2019-01-02

    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.
  15. Lokesh Choudhary 2019-01-02

    [~michael], I can reproduce the issue it with ti.animation & latest 8.0.0 SDK. I will reopen the ticket for now.
  16. Lokesh Choudhary 2019-01-02

    Reopening for now as the issue is seen with ti.animation.
  17. Gary Mathews 2019-01-08

    master: https://github.com/appcelerator/titanium_mobile/pull/10577
  18. Lokesh Choudhary 2019-01-08

    FR Passed. Waiting for merge to be ready.
  19. Lokesh Choudhary 2019-01-08

    Master PR merged.
  20. Gary Mathews 2019-01-08

    8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10586

JSON Source