Alex Tertyshnyk
Alex Tertyshnyk

Reputation: 71

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.

Upvotes: 0

Views: 304

Answers (2)

abada henno
abada henno

Reputation: 740

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>

Upvotes: 1

Thomas Lemaitre
Thomas Lemaitre

Reputation: 1154

The module="xp.ui" from your index transform Window into View for Android. On your Home.xml you have 1 Window for both platform but the code is the same ! So, in your Home.xml replace Window by a View like this :

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

Your problem is on both platform ? iOS ? Android ? By the way, your screenshot is not public so we can't see it.

Upvotes: 0

Related Questions