Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on Android #89

Closed
jonywtf opened this issue Jun 4, 2017 · 2 comments
Closed

crash on Android #89

jonywtf opened this issue Jun 4, 2017 · 2 comments

Comments

@jonywtf
Copy link

jonywtf commented Jun 4, 2017

Log:

Attempted to transition from state `RESPONDER_INACTIVE_PRESS_IN` to `RESPONDER_ACTIVE_LONG_PRESS_IN`, which is not supported. This is most likely due to `Touchable.longPressDelayTimeout` not being cancelled.
reactConsoleErrorHandler	@	ExceptionsManager.js:71
console.error	@	YellowBox.js:62
_handleLongDelay	@	Touchable.js:628
proxiedMethod	@	createPrototypeProxy.js:44
(anonymous)	@	JSTimers.js:92
callTimer	@	JSTimersExecution.js:95
callTimers	@	JSTimersExecution.js:136
__callFunction	@	MessageQueue.js:250
(anonymous)	@	MessageQueue.js:101
__guard	@	MessageQueue.js:218
callFunctionReturnFlushedQueue	@	MessageQueue.js:100
(anonymous)	@	debuggerWorker.js:71

My test app is very simple.
And it crash sometimes when i try to close my sideMenu.

import React, { Component } from 'react';
import { AppRegistry, StyleSheet, View, TouchableOpacity, Image, Dimensions } from 'react-native';

import { StyleProvider, Container, Content, Text, Button} from 'native-base';
import { Icon, Body } from 'native-base';
import { Header, Left, Right, Title } from 'native-base';
import { Footer, FooterTab } from 'native-base';
import { List, ListItem } from 'native-base';

import Interactable from 'react-native-interactable';

const Screen = Dimensions.get('window');
const SideMenuWidth = 280;
const RemainingWidth = Screen.width - SideMenuWidth;

export default class rapp extends Component {

    onMenuPress() {
        this.refs['menuInstance'].setVelocity({x: 2000});
    }
    onClosePress() {
        this.refs['menuInstance'].setVelocity({x: -2000});
    }
    render() {

        return (
            <Container>
                <View style={styles.sideMenuContainer} pointerEvents='box-none'>
                    <Interactable.View
                        ref='menuInstance'
                        horizontalOnly={true}
                        snapPoints={[{x: 0}, {x: -SideMenuWidth}]}
                        boundaries={{right: RemainingWidth/2}}
                        initialPosition={{x: -SideMenuWidth}}
                    >
                        <View style={styles.sideMenu}>
                            <Container>
                                <Content>
                                    <Text>Menu</Text>
                                    <Button full onPress={this.onMenuPress.bind(this)}>
                                        <Text> Open! </Text>
                                    </Button>
                                    <Button full onPress={this.onClosePress.bind(this)}>
                                        <Text> Close! </Text>
                                    </Button>
                                    <List>
                                        <ListItem itemDivider>
                                            <Text>A</Text>
                                        </ListItem>
                                        <ListItem >
                                            <Text>Aaron Bennet</Text>
                                        </ListItem>
                                        <ListItem>
                                            <Text>Ali Connors</Text>
                                        </ListItem>
                                        <ListItem itemDivider>
                                            <Text>B</Text>
                                        </ListItem>
                                        <ListItem>
                                            <Text>Bradley Horowitz</Text>
                                        </ListItem>
                                    </List>
                                </Content>
                            </Container>
                        </View>
                    </Interactable.View>
                </View>

                <Header>
                    <Left>
                        <Button onPress={this.onMenuPress.bind(this)} transparent>
                            <Icon name='menu' />
                        </Button>
                    </Left>
                    <Body>
                        <Title>Header</Title>
                    </Body>
                    <Right>
                        <Button transparent>
                            <Icon name='menu' />
                        </Button>
                    </Right>
                </Header>

                <Content>
                    <Button onPress={this.onMenuPress.bind(this)}>
                        <Text> Open! </Text>
                    </Button>
                    <Button onPress={this.onClosePress.bind(this)}>
                        <Text> Close! </Text>
                    </Button>
                </Content>

                <Footer >
                    <FooterTab>
                        <Button>
                            <Text>Apps</Text>
                        </Button>
                        <Button>
                            <Text>Camera</Text>
                        </Button>
                        <Button active>
                            <Text>Navigate</Text>
                        </Button>
                        <Button>
                            <Text>Contact</Text>
                        </Button>
                    </FooterTab>
                </Footer>
            </Container>
        );
    }
}

const styles = StyleSheet.create({
    sideMenuContainer: {
        position: 'absolute',
        top: 0,
        left: -RemainingWidth,
        right: 0,
        bottom: 0,
        flexDirection: 'row',
        zIndex: 1002
    },
    sideMenu: {
        left: 0,
        width: Screen.width,
        paddingLeft: RemainingWidth,
        flex: 1,
        backgroundColor: '#aaa',
        paddingTop: 80
    }
});

AppRegistry.registerComponent('reactapp', () => rapp);
@moret
Copy link

moret commented Jun 28, 2017

@jonywtf I was looking for a closely related issue and ended up finding that there seems to be an issue when using <List> inside a <Content>. I hope it helps.

@rotemmiz
Copy link
Contributor

I am closing the issue as a part of an effort to cleanup and revive the project. If this issue persists after v1.0.0, you are more than welcome to reintroduce it.

Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants