yamill / react-native-orientation

Listen to device orientation changes in react-native and set preferred orientation on screen to screen basis.
https://www.npmjs.com/package/react-native-orientation
ISC License
1.72k stars 809 forks source link

【Android】Crash on Android with quick clicking many times while locking to portrait #385

Closed arlovip closed 4 years ago

arlovip commented 4 years ago

On Android, when locking to portrait with quick clicking many times. It causes crash always on Android but works perfectly on iOS.

The screenshot as follows:

error

I searched the all issues and stackoverflow but it didn't help. Anyone has the same problem for that?

arlovip commented 4 years ago
  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (4) x64 Intel(R) Core(TM) i3-8100B CPU @ 3.60GHz
      Memory: 30.76 MB / 8.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.10.0 - /usr/local/bin/node
      Yarn: 1.17.3 - ~/.yarn/bin/yarn
      npm: 6.11.3 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
      Android SDK:
        API Levels: 23, 26, 27, 28
        Build Tools: 23.0.1, 26.0.1, 27.0.3, 28.0.2, 28.0.3
        System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.5 AI-191.8026.42.35.5977832
      Xcode: 11.3.1/11C505 - /usr/bin/xcodebuild
    npmPackages:
      react: ^16.6.0-alpha.8af6728 => 16.13.1
      react-native: 0.57.4 => 0.57.4
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-demo-for-npm: 1.0.16
      react-native-update-cli: 0.1.0
D/receiver: 2
D/receiver: 2
I/HiTouch_HiTouchSensor: HiTouch Setting Switch, OFF
I/HiTouch_HiTouchSensor: Checking pkgName: com.wanke Checking result: true
    isSecrutiyIMEPopup:false
I/HiTouch_HiTouchSensor: HiTouch Setting Switch, OFF
I/HiTouch_HiTouchSensor: Checking pkgName: com.wanke Checking result: true
I/HiTouch_HiTouchSensor: isSecrutiyIMEPopup:false
W/HiTouch_PressGestureDetector: Touch pointer move a lot. The moving distance of X is:229.0, limit is:60The moving distance of Y is:405.0, limit is:60
I/HiTouch_HiTouchSensor: HiTouch Setting Switch, OFF
I/HiTouch_HiTouchSensor: Checking pkgName: com.wanke Checking result: true
    isSecrutiyIMEPopup:false
W/HiTouch_PressGestureDetector: Touch pointer move a lot. The moving distance of X is:Infinity, limit is:60The moving distance of Y is:Infinity, limit is:60
E/unknown:ReactNative: Exception in native call
    java.lang.RuntimeException: Error calling RCTEventEmitter.receiveTouches
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:888)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:213)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:929)
     Caused by: java.lang.RuntimeException: folly::toJson: JSON object value was a NaN or INF
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:888) 
        at android.os.Handler.dispatchMessage(Handler.java:100) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29) 
        at android.os.Looper.loop(Looper.java:213) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192) 
        at java.lang.Thread.run(Thread.java:929) 
E/unknown:ReactNative: Exception in native call
    java.lang.RuntimeException: Error calling RCTEventEmitter.receiveTouches
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:888)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:213)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:929)
     Caused by: java.lang.RuntimeException: folly::toJson: JSON object value was a NaN or INF
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:888) 
        at android.os.Handler.dispatchMessage(Handler.java:100) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29) 
        at android.os.Looper.loop(Looper.java:213) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192) 
        at java.lang.Thread.run(Thread.java:929) 
arlovip commented 4 years ago

Focused

arlovip commented 4 years ago

Sorry. After having a try many times. Finally, this is because of React Native version (0.57.4). On RN 0.57.4, the error above always can be reproduced but it is normal on the latest React Native. Closing this issue.