Search code examples
androidnativescriptandroid-bundle

Android App Bundle Functionality Mismatch


In my Nativescript application, I display something like following:

Item 1 of 10

Item 2 of 10

....

Item 10 of 10

For which, I have following code which works just fine normally

<ListView id="listView" items="{{ items }}" itemTemplateSelector="$index">
    <ListView.itemTemplate>
        <StackLayout>
            <Label marginTop="20" textAlignment="center" fontWeight="Bold">
                <Label.formattedText>
                    <FormattedString>
                        <FormattedString.spans>
                            <span text="Item " />
                            <span text="{{ $index + 1 }}"/>
                            <span text=" Of "/>
                            <span text="{{$parents['ListView'].items, $parents['ListView'].items.length }}" />
                        </FormattedString.spans>
                    </FormattedString>
                </Label.formattedText>
            </Label>
        </StackLayout>
    </ListView.itemTemplate>
</ListView>

but when I release the Android App Bundle as mentioned at https://docs.nativescript.org/angular/tooling/publishing/android-app-bundle this produces something like following:

Item 1 of [Object, Object]

Item 2 of [Object, Object]

....

Item 10 of [Object, Object]

Does anyone know how to handle this case and why the functionality differs from the normal one?


Solution

  • This is a bug in nativescript. I have raised an issue https://github.com/NativeScript/NativeScript/issues/7449 for the same.