I am getting an error while trying to use a custom/reusable xml template


#1

Issue occured on:
-platform: Android
-CLI: tns 2.5.4
-Cross-platform modules: 2.5.0
-Runtime(s): “tns-android”: {“version”: “2.5.0”}

Description of Issue:
I am getting an error while trying to use a custom/reusable xml template, I have created a custom/reusable xml template at app/shared/views/customActionBar.xml:

<Page.actionBar>
    <ActionBar title="Sign up"></ActionBar>
</Page.actionBar>

then I tried to use it in app/views/login/login.xml as follows:

<Page
    loaded="loaded"
    xmlns:sharedViews="shared/views"
>
    <sharedViews:customActionBar />
    <StackLayout orientation="vertical">
        <Image src="res://logo" stretch="none" horizontalAlignment="center" />
        <TextField id="email" text="{{ email }}" hint="Email Address" keyboardType="email" autocorrect="false" autocapitalizationType="none" />
        <TextField secure="true" text="{{ password }}" hint="Password" />

        <Button text="Sign in" tap="signIn" />
        <Button text="Sign up for Groceries" class="link" tap="register" />
    </StackLayout>
</Page>

then I got the following error when I run tns run android:

An uncaught Exception occurred on “main” thread.
java.lang.RuntimeException: Unable to start
activity ComponentInfo{org.nativescript.Groceries/
com.tns.NativescriptActivity}:
com.tns.NativeScriptException:
Calling js method onCreate failed

Error: Building UI from XML.
@file:///app/views/login/login.xml:5:5

Building UI from XML.
@file:///app/shared/views/customActionBar.xml:1:1
cannot read property ‘exports’ of undefined
File: "file:///data/data/org.nativescript.Groceries/files/app
/tns_modules/tns-core-modules/ui/builder/builder.js, line:
175, column: 20