question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App Crashes on Pull to Refresh

See original GitHub issue

Description

App crashes when swiping to refresh a ScrollView

Note: It works with 2.0.0-alpha.8 so the bug was likely introduced by 2.0.0-alpha.9

Screenshots

com.facebook.jni.CppException Value is null, expected an Object

Error: Value is null, expected an Object 
    NativeProxy.java:-2 com.swmansion.reanimated.NativeProxy$EventHandler.receiveEvent
    NativeProxy.java:60 com.swmansion.reanimated.NativeProxy$EventHandler.receiveEvent
    RefreshEvent.java:26 com.facebook.react.views.swiperefresh.RefreshEvent.dispatch
    NodesManager.java:471 com.swmansion.reanimated.NodesManager.handleEvent
    NodesManager.java:448 com.swmansion.reanimated.NodesManager.onEventDispatch
    EventDispatcher.java:114 com.facebook.react.uimanager.events.EventDispatcher.dispatchEvent
    SwipeRefreshLayoutManager.java:147 com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager$1.onRefresh
    SwipeRefreshLayout.java:195 androidx.swiperefreshlayout.widget.SwipeRefreshLayout$1.onAnimationEnd
    CircleImageView.java:107 androidx.swiperefreshlayout.widget.CircleImageView.onAnimationEnd
    ViewGroup.java:6912 android.view.ViewGroup.finishAnimatingView
    View.java:20272 android.view.View.draw
    ViewGroup.java:4337 android.view.ViewGroup.drawChild
    ViewGroup.java:4116 android.view.ViewGroup.dispatchDraw
    View.java:20369 android.view.View.draw
    View.java:19241 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ViewGroup.java:4321 android.view.ViewGroup.recreateChildDisplayList
    ViewGroup.java:4294 android.view.ViewGroup.dispatchGetDisplayList
    View.java:19201 android.view.View.updateDisplayListIfDirty
    ThreadedRenderer.java:690 android.view.ThreadedRenderer.updateViewTreeDisplayList
    ThreadedRenderer.java:696 android.view.ThreadedRenderer.updateRootDisplayList
    ThreadedRenderer.java:805 android.view.ThreadedRenderer.draw
    ViewRootImpl.java:3517 android.view.ViewRootImpl.draw
    ViewRootImpl.java:3314 android.view.ViewRootImpl.performDraw
    ViewRootImpl.java:2683 android.view.ViewRootImpl.performTraversals
    ViewRootImpl.java:1635 android.view.ViewRootImpl.doTraversal
    ViewRootImpl.java:7788 android.view.ViewRootImpl$TraversalRunnable.run
    Choreographer.java:1004 android.view.Choreographer$CallbackRecord.run
    Choreographer.java:816 android.view.Choreographer.doCallbacks
    Choreographer.java:751 android.view.Choreographer.doFrame
    Choreographer.java:990 android.view.Choreographer$FrameDisplayEventReceiver.run
    Handler.java:873 android.os.Handler.handleCallback
    Handler.java:99 android.os.Handler.dispatchMessage
    Looper.java:193 android.os.Looper.loop
    ActivityThread.java:6898 android.app.ActivityThread.main
    Method.java:-2 java.lang.reflect.Method.invoke
    RuntimeInit.java:537 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
    ZygoteInit.java:858 com.android.internal.os.ZygoteInit.main

Steps To Reproduce

Swipe down to trigger the refresh

Expected behavior

No crash

Actual behavior

Crash

Snack or minimal code example

import React from 'react'
import {  RefreshControl, ScrollView } from 'react-native'

const Screen = function () {
  const [refresh, setRefresh] = React.useState(false)
  return (
        <ScrollView
        refreshControl={
            <RefreshControl
                refreshing={refreshing}
                onRefresh={() => console.log('refresh')}
                colors={['red']}
            />
        }>
      </ScrollView>
  )
}

Package versions

  • React: 16.13.1
  • React Native: 0.63.2
  • React Native Reanimated: ^2.0.0-alpha.9

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

1reaction
ajpaulingallscommented, Nov 20, 2020

I too get this issue for alpha.9. How can i get alpha.8 meanwhile when this issue is fixed?

Need to update both package.json and yarn.lock. Here is the yarn.lock snippet:

react-native-reanimated@^2.0.0-alpha.8:
  version "2.0.0-alpha.8"
  resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.0.0-alpha.8.tgz#9b8ce77cea315bfc356f190eecec7763d19d4c26"
  integrity sha512-WCeMwZW1ZOCkY1ANFDP2Iwei2bxO/LftxTmx0XiCbQl8+csctpB5I1GERuzCZNJZ1NLR9/LBqrJIr/Vl8/TnjQ==
  dependencies:
    "@babel/plugin-transform-object-assign" "^7.10.4"
    fbjs "^3.0.0"
    string-hash-64 "^1.0.3"
0reactions
mym0404commented, Nov 23, 2020

How is it going? will this bug be fixed next release? This bug is produced only Android

Read more comments on GitHub >

github_iconTop Results From Across the Web

UITable pull down to refresh crashes app - swift - Stack Overflow
Try setting up breakpoints to figure out which line (if it is a line of code, which it probably is) causes the crash....
Read more >
Pull to refresh resulting app to c… | Apple Developer Forums
I wrote code for pull to refresh but it crashed IF the result array count is different from the indexPath.row and I've tried...
Read more >
[Solved]-App crashes when I use pull down to refresh in UITableView
[Solved]-App crashes when I use pull down to refresh in UITableView ... viewDidLoad() refresh = UIRefreshControl() refresh.
Read more >
Adding Swipe-to-Refresh To Your App - Android Developers
The swipe-to-refresh user interface pattern is implemented entirely within the SwipeRefreshLayout widget, which detects the vertical swipe, ...
Read more >
Refresh Data List View causing Live crash
In a few screens I have place in the open event the refresh data viewer block - with this block the Live Thunkable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found