Coder Social home page Coder Social logo

Comments (29)

ithieund avatar ithieund commented on August 17, 2024 2

Same for me.
App crash after sometimes showing spinner when calling fetch() and hiding spinner when fetch() done.

*** Assertion failure in __33-[RCTUIManager setFrame:forView:]_block_invoke(), /node_modules/react-native/React/Modules/RCTUIManager.m:440
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not locate shadow view with tag #1092'
*** First throw call stack:
(0x181d59900 0x1813c7f80 0x181d597d0 0x1826cca08 0x1001638e4 0x100b5dbf0 0x100b5dbb0 0x100b6a6c8 0x100b618a0 0x100b6c7e0 0x100b6c4d8 0x1819c1470 0x1819c1020)
libc++abi.dylib: terminating with uncaught exception of type NSException

Is there any fix for this bug?
Thanks

from react-native-loading-spinner-overlay.

lprhodes avatar lprhodes commented on August 17, 2024 1

I'm seeing this too - it looks to be a timing thing, I would guess some kind of race condition with the state somewhere.

I find that using a timeout as shown below helped to prevent this error and also prevented occurrences when the spinner overlay doesn't get removed.

setTimeout(() => {
  this.setState({ visible: false })
}, 300)

from react-native-loading-spinner-overlay.

lprhodes avatar lprhodes commented on August 17, 2024 1

from react-native-loading-spinner-overlay.

niftylettuce avatar niftylettuce commented on August 17, 2024

Does this still occur?

from react-native-loading-spinner-overlay.

kelvin-lima avatar kelvin-lima commented on August 17, 2024

Some times. Im using a workaround at this moment.

from react-native-loading-spinner-overlay.

kelvin-lima avatar kelvin-lima commented on August 17, 2024

It is occurring during a change of state from Hide to Show or vice-versa. In some moments, i change the state of visible variable and the spinner not change visibility.

from react-native-loading-spinner-overlay.

milesegan avatar milesegan commented on August 17, 2024

@KelvinEC What workaround are you using? I'm seeing something like this too.

from react-native-loading-spinner-overlay.

kelvin-lima avatar kelvin-lima commented on August 17, 2024

So, @milesegan The Workaround not work. I removed the library completely and start using another strategy.

from react-native-loading-spinner-overlay.

prithsharma avatar prithsharma commented on August 17, 2024

Any updates on this, this is happening quite frequently for me.
Although I'm using 0.2.3 right now - could this be something that got fixed in later versions?

from react-native-loading-spinner-overlay.

prithsharma avatar prithsharma commented on August 17, 2024

@niftylettuce any idea on this one?

from react-native-loading-spinner-overlay.

nickrobinson352 avatar nickrobinson352 commented on August 17, 2024

having same issue too !

from react-native-loading-spinner-overlay.

niftylettuce avatar niftylettuce commented on August 17, 2024

@SandroMachado can you help here

from react-native-loading-spinner-overlay.

SandroMachado avatar SandroMachado commented on August 17, 2024

This library does not use native code, so the issue is probably in RN.

I am using this library with RN 0.39.0 and RN 0.40.0 and I were not able to reproduce this issue.

Again, I believe that this is a RN issue and not an issue in the library, at least based in the crashlog.

Can someone create a test project that reproduces this?

from react-native-loading-spinner-overlay.

RobTS avatar RobTS commented on August 17, 2024

Having problems myself at the moment, the app is sometimes crashing on startup and my error matches this description: facebook/react-native#10845

I use the spinner very early in the application lifecycle, maybe it has to do with that. I can't say for sure the reason for that is actually this library, but as there was a similar issue open, I thought I'd attach mine here.

01-18 16:28:20.939 25968 26004 E AndroidRuntime: Process: com.icouldcall.android, PID: 25968
01-18 16:28:20.939 25968 26004 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.facebook.react.uimanager.ReactShadowNode.setStyleWidth(float)' on a null object reference
01-18 16:28:20.939 25968 26004 E AndroidRuntime:        at com.facebook.react.uimanager.UIImplementation.updateNodeSize(UIImplementation.java:151)
01-18 16:28:20.939 25968 26004 E AndroidRuntime:        at com.facebook.react.uimanager.UIManagerModule.updateNodeSize(UIManagerModule.java:213)
01-18 16:28:20.939 25968 26004 E AndroidRuntime:        at com.facebook.react.views.modal.ReactModalHostView$DialogRootViewGroup$1.run(ReactModalHostView.java:302)
01-18 16:28:20.939 25968 26004 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java)
01-18 16:28:20.939 25968 26004 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java)
01-18 16:28:20.939 25968 26004 E AndroidRuntime:        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
01-18 16:28:20.939 25968 26004 E AndroidRuntime:        at android.os.Looper.loop(Looper.java)
01-18 16:28:20.939 25968 26004 E AndroidRuntime:        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
01-18 16:28:20.939 25968 26004 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:818)
01-18 16:28:20.941  3060  5034 W ActivityManager:   Force finishing activity com.icouldcall.android/.MainActivity

from react-native-loading-spinner-overlay.

drinkingcode avatar drinkingcode commented on August 17, 2024

@KelvinEC upgrade react-native to 0.41.0 , it works fine !

from react-native-loading-spinner-overlay.

drinkingcode avatar drinkingcode commented on August 17, 2024

finally, I solve this problem as following:

`export default class Loading extends Component{

constructor(props){
    super(props);
    this.state={
        visible:this.props.visible
    };
    this._show=this._show.bind(this);
    this._hide=this._hide.bind(this);
}

render(){
    return(
        <Modal
            animationType={'none'}
            transparent={true}
            visible={this.state.visible}
            onRequestClose={this.props.onDismissLoadingCallback}>
            <View style={{flex:1}}/>
            <View style={{
                height:80,
                width:80,
                alignItems:'center',
                justifyContent:'center',
                backgroundColor:'#3434347f',
                borderRadius:10,alignSelf:'center'}}>
                <ActivityIndicator
                    animating={true}
                    size={"large"}
                    color={'white'}
                />
            </View>
            <View style={{flex:1}}/>
        </Modal>
    );
}

_show() {
this.setState({visible:true});
}

_hide(){
this.setState({visible:false});
}

`

it works well !

from react-native-loading-spinner-overlay.

lprhodes avatar lprhodes commented on August 17, 2024

from react-native-loading-spinner-overlay.

jmknoll avatar jmknoll commented on August 17, 2024

Same issues here. RN v0.36.0.

I have the spinner inside of a Modal, and 100% of the time when I set visible to false it causes app to crash.

from react-native-loading-spinner-overlay.

Thyiad avatar Thyiad commented on August 17, 2024

+1, rn 0.42

from react-native-loading-spinner-overlay.

Thyiad avatar Thyiad commented on August 17, 2024

It crash on release mode

from react-native-loading-spinner-overlay.

cenkakin avatar cenkakin commented on August 17, 2024

This is related with RN issue which is mentioned above. It is fixed and released on v0.43.3. I didn't face crashes after that version.

facebook/react-native#10845 (comment)

from react-native-loading-spinner-overlay.

Thyiad avatar Thyiad commented on August 17, 2024

Yes, just find commit here: facebook/react-native@5873a22

Trying upgrade to 0.44 now.

from react-native-loading-spinner-overlay.

SandroMachado avatar SandroMachado commented on August 17, 2024

Closed by facebook/react-native#10845 (comment)

from react-native-loading-spinner-overlay.

jbolter avatar jbolter commented on August 17, 2024

This is still happening with RN 0.45.1 to me. When I remove the spinner the problem seems to go away but I haven't spent a ton of time debugging. I agree that it seems to be timing based since it is not consistent.

from react-native-loading-spinner-overlay.

jmknoll avatar jmknoll commented on August 17, 2024

@jbolter I spent a bit of time debugging this issue a couple of months ago and, iirc, it was related to dismissing the modal containing the activity indicator while the indicator is still visible. I couldn't find a workaround, so I threw together a simple component which addressed the problem by showing/hiding the activity indicator directly. https://github.com/jmknoll/react-native-overlay-spinner

If you want to avoid a dependency, and since you're on RN 0.45, you can just use ActivityIndicator directly. https://facebook.github.io/react-native/docs/activityindicator.html

from react-native-loading-spinner-overlay.

jbolter avatar jbolter commented on August 17, 2024

@jmknoll Thanks! I'll give your lib a try since I would like the background overlay still which I don't think I can get with the ActivityIndicator directly.

from react-native-loading-spinner-overlay.

jmknoll avatar jmknoll commented on August 17, 2024

@jbolter Great. If you run into any problems just open up an issue over there and I’ll try to get it addressed in a timely manner.

from react-native-loading-spinner-overlay.

jose920405 avatar jose920405 commented on August 17, 2024

Same issue here in "react-native": "0.51.0"

from react-native-loading-spinner-overlay.

beausmith avatar beausmith commented on August 17, 2024

Having the same issue with the Modal component in "react-native": "0.55.4" 🙁

Using a setTimeout around the setState which updates the visible prop of the Modal component works, albeit unreliably based upon the length of the timeout. After trying different lengths of time we settled on 1000 as a time that was long enough to "locate shadow view" but short enough to not annoy users.

If this doesn't work, I'll be taking the strategy suggested by @jmknoll to replace the Modal component from react-native with an absolutely positioned View component.

from react-native-loading-spinner-overlay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.