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

Attempted to transition from state RESPONDER_INACTIVE_PRESS_IN to RESPONDER_ACTIVE_LONG_PRESS_IN, which is not supported. #11989

Closed
magrinj opened this issue Jan 19, 2017 · 46 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@magrinj
Copy link
Contributor

magrinj commented Jan 19, 2017

Same as #5823 that has been closed, when I'm in debugging mode with react-native@0.36.1 I got sometimes this error randomly:

console.error: "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."
Object.console.error
    YellowBox.js:61
Constructor._handleLongDelay
    Touchable.js:595
Constructor.proxiedMethod [as _handleLongDelay]
    createPrototypeProxy.js:44
<unknown>
    JSTimers.js:78
Object.callTimer
    JSTimersExecution.js:99
Object.callTimers
    JSTimersExecution.js:140
MessageQueue.__callFunction
    MessageQueue.js:236
<unknown>
    MessageQueue.js:108
guard
    MessageQueue.js:46
MessageQueue.callFunctionReturnFlushedQueue
    MessageQueue.js:107
message
    RNDebuggerWorker.js:123:57

Apparently, thanks to #5823 the code can be reproduced like that:

class App extends Component {
  constructor() {
    super()
    this.state = {
      testText: ''+Math.random()
    }
  }

  _updateTouch(e) {
    this.setState({testText: ''+Math.random()})
  }

  render() {
    return (
      <View style={styles.container}>
        <Text>
          {this.state.testText}
        </Text>
        <TouchableHighlight onPress={this._updateTouch.bind(this)}>
          <Image
            style={width: 100, height: 100}
            source={{uri: 'http://facebook.github.io/react/img/logo_og.png'}}
          />
        </TouchableHighlight>
      </View>
    );
  }
}

I see a lot of people having the same issue on the old ticket, so I choose to open a new one because the old one is actually closed.

@fungilation
Copy link

fungilation commented Jan 25, 2017

My console.error output:

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:61
_handleLongDelay @ Touchable.js:596
(anonymous) @ JSTimers.js:80
callTimer @ JSTimersExecution.js:95
callTimers @ JSTimersExecution.js:136
__callFunction @ MessageQueue.js:236
(anonymous) @ MessageQueue.js:108
guard @ MessageQueue.js:46
callFunctionReturnFlushedQueue @ MessageQueue.js:107
onmessage @ debuggerWorker.js:44

I'm on RN 0.37. I haven't hit this error in iOS simulator, but got this on physical iPhone 6S on iOS 10.2.1.

@cparjaszewski
Copy link

Same issue here

@jsers
Copy link

jsers commented Feb 9, 2017

+1
iPhone 6 on iOS 10.2

@jose920405
Copy link

+1

1 similar comment
@rodperottoni
Copy link

+1

@sebastian-palma
Copy link

This only happens to me when Remote JS Debugging is enabled, at least on Android 6, RN v0.41.2.

@arkhwise
Copy link

arkhwise commented Feb 27, 2017

react-native: "0.40.0"

I faced with this issue when the following conditions:

  • Remote JS debugging is on
  • View has two components, one of them is conditional
<View style={styles.btnWrapper}>
  <TextButton
    title='text'
    onPress={this.foo}
  />
  {
   this.props.enableHint &&
   <TextButton
    title='text'
    onPress={this.bar}
   />
  }
</View>
// TextButton
<TouchableHighlight
  onPress={this.props.onPress}
>
  <Text>
    {this.props.title}
  </Text>
</TouchableHighlight>
  • When enableHint is eq false, RN throws this error

I change <TouchableHighlight> to <TouchableOpacity> and that's works.

@langjun
Copy link

langjun commented May 12, 2017

+1

Android 7.1.1
Nexus 6

image

@ddellamico
Copy link

+1

1 similar comment
@devken-net
Copy link

+1

@jasonmerino
Copy link

I am also getting this error when remote JS debugging is on my Android device. RN v0.42.3

@spencewine
Copy link

+1 RN 0.42.0

@sporteman
Copy link

+1 RN 0.44

@ank-khandelwal
Copy link

+1 RN 0.44.2

@half-shell
Copy link

+1 RN 0.45.1
I'm really sorry to keep the spam going, but it's been bothering be for a while now, and I think it is the reason my apps closes itself now and then.

I'd be happy to provide any useful information in order to solve this issue.

@jonathanroze
Copy link

+1

@bgoyal2222
Copy link

+1 RN 0.43.4

@Larry-Liu2016
Copy link

Hey everyone. Just check the clocks on your computer and phone. If there is a noticeable difference, disable the auto setting on one device and change it to match the other.

My android phone's clock was around 7s earlier than the clock on my Mac, and there was ~ 1/3 chance to trigger the error when button is pressed with chrome debugging on. After I adjust the clock to reduce the difference to around 1s (without changing any code), the problem is gone.

@fungilation
Copy link

fungilation commented Jul 10, 2017 via email

@yash2code
Copy link

+1

2 similar comments
@MrToph
Copy link

MrToph commented Jul 22, 2017

+1

@ghulamMustafaRaza
Copy link

+1

@fungilation
Copy link

STOP with the +1 spam. Just give the original post or whichever comment a thumbs up 👍🏼 if you see the same.

@compojoom
Copy link
Contributor

I just did what @Larry-Liu2016 suggested and this worked for me on RN 0.47.2
This also seems to solve the onlongpress issue reported here: #4944

Thanks @Larry-Liu2016

@Ariel08081214
Copy link

RN 0.48.2 +1
How is this question triggered?
What is the solution?

@compojoom
Copy link
Contributor

@danna88 try to set the phone's time manually and make sure it's equal to the computer time. Then let us know if you still experience the issue.

@michelebombardi
Copy link

+1 RN 0.48.3

@hassanjallow
Copy link

@Larry-Liu2016 suggestion worked for me on RN 0.46.4. Thanks

@koansang
Copy link

+1 RN 0.49.3 on Android

@syzer
Copy link

syzer commented Oct 18, 2017

+1 on Android

@DevCappe
Copy link

+1

1 similar comment
@mhdizade
Copy link

+1

@gino8080
Copy link

gino8080 commented Nov 6, 2017

Solved using React Native debugger instead of plain Chrome window

@tasneembohra
Copy link

@Larry-Liu2016 +1

@jetonk
Copy link

jetonk commented Nov 30, 2017

@Larry-Liu2016 is right, I have synchronized time to my android mobile phone with the computers time, exactly the same even the seconds, and now that error does not appear.

@alanyong91
Copy link

We solutions over here. Stop comment +1. Not just here. In every post, please don't comment "me too" and "+1". Thanks for the cooperation

@sneerin
Copy link

sneerin commented Dec 29, 2017

the solution to fix the clock is not an option, you can't say every customer to fix their time.

@jetonk
Copy link

jetonk commented Dec 29, 2017

@sneerin This issue it is just in development mode, not in production..

@SkyzohKey
Copy link

@jetonk Still pretty boring when you develop and your app crash cuz of that shit. e.e

@DarkHollow
Copy link

Time synchronized and not working...
I have also tried inserting View inside TouchableNativeFeedback with the same result.

@mohammad-goldast
Copy link

Android 7 & RN 0.53

I've same issue with TouchableHighlight

@RobTS
Copy link

RobTS commented Feb 21, 2018

Time synchronized, not working here either...

@Piropa
Copy link

Piropa commented Feb 23, 2018

My practical solution was to edit react-native source code at:
node-modules/react-native/Libraries/Components/Touchable/Touchable.js

Here I've changed "console.error" to "console.log" at line 628, this way I receive the message, however my app is not interrupted and the error is "dissmissed"

You could also use "console.warn" if you still want to get track of the error, turning it into a warning.

starting at line 623:

  _handleLongDelay: function(e) {
    this.longPressDelayTimeout = null;
    var curState = this.state.touchable.touchState;
    if (curState !== States.RESPONDER_ACTIVE_PRESS_IN &&
        curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {
      // console.error('Attempted to transition from state `' + curState + '` to `' +
      console.log('Attempted to transition from state `' + curState + '` to `' +
        States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' +
        'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');
    } else {
      this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);
    }
  },

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 24, 2018
@pacozaa
Copy link

pacozaa commented Mar 10, 2018

@Piropa Thank you. +1

@hramos
Copy link
Contributor

hramos commented Apr 4, 2018

Locking due to repetitive +1 comments. A solution was posted a long time ago by @Larry-Liu2016 here. In summary, check the clock on your devices.

@facebook facebook locked as resolved and limited conversation to collaborators Apr 4, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests