Search code examples
androidappceleratorappcelerator-mobileappcelerator-titanium

Appcelerator titanium runtime error


I have an existing project that was not developped for more than a half a year. Now i need to support it. I have updated Titanium SDK and all other libraries used in the project. But right after the launch of the application on the device i have runtime error. The screenshot of the error:

enter image description here

I'm surprised because this was the stable version of the app ready for production. So only after updating libraries this error occurs. Here's some parts of the code:

This is the 'index' view:

<?xml version="1.0"?>
<Alloy>
<Widget id="drawer" src="nl.fokkezb.drawer">
    <Window module="xp.ui" role="leftWindow" >
        ......
    </Window>
    <NavigationWindow platform="ios" role="centerWindow">
        <Require type="view" src="Home"/>
    </NavigationWindow>
    <Window module="xp.ui" platform="android" role="centerWindow" home="Home">
        <Require type="view" src="Home"/>
    </Window>
</Widget>
</Alloy>

and HOME.xml

<Alloy>
<Window id="winHome" platform="ios" class="container whiteBackground no-navbar" navBarHidden="true" layout="vertical" opacity="1">
    <Require type="view" src="homeContent"></Require>
</Window>
<Window id="winHome" platform="android" class="container whiteBackground no-navbar" navBarHidden="true" layout="vertical" opacity="1">
    <Require type="view" src="homeContent"></Require>
</Window>
</Alloy>

and homeContent:

<Alloy>
<View id="winHomeContent" class="container whiteBackground" layout="composite" visible = "false">
    <View class="ver">
        .........
    </View>
    <View bottom="0" class="h-size">
        <Require type="view" src="homeFooter"/>
    </View>
</View>
</Alloy>

I see that both 'index' and Home views have "Window" tags. But this exact code was working earlier.


Solution

  • In index.xml from Doc nl.fokkezb.drawer

    centerWindow role is a View not an Window

    <Alloy>
        <Widget id="drawer" src="nl.fokkezb.drawer">
    
            <Window module="xp.ui" role="leftWindow">
                <Label>I am left</Label>
            </Window>
    
            <NavigationWindow platform="ios" role="centerWindow">
                <Window>
                    <LeftNavButton>
                        <Button onClick="toggle">Left</Button>
                    </LeftNavButton>
                    <Label>I am center</Label>
                    <RightNavButton>
                        <Button onClick="toggle">Right</Button>
                    </RightNavButton>
                </Window>
            </NavigationWindow>
            <View platform="android" role="centerWindow">
                <Label>I am center</Label>
            </View>
    
            <Window module="xp.ui" role="rightWindow">
                <Label>I am right</Label>
            </Window>
    
        </Widget>
    </Alloy>