Comments (29)
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.
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.
from react-native-loading-spinner-overlay.
Does this still occur?
from react-native-loading-spinner-overlay.
Some times. Im using a workaround at this moment.
from react-native-loading-spinner-overlay.
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.
@KelvinEC What workaround are you using? I'm seeing something like this too.
from react-native-loading-spinner-overlay.
So, @milesegan The Workaround not work. I removed the library completely and start using another strategy.
from react-native-loading-spinner-overlay.
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.
@niftylettuce any idea on this one?
from react-native-loading-spinner-overlay.
having same issue too !
from react-native-loading-spinner-overlay.
@SandroMachado can you help here
from react-native-loading-spinner-overlay.
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.
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.
@KelvinEC upgrade react-native to 0.41.0 , it works fine !
from react-native-loading-spinner-overlay.
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.
from react-native-loading-spinner-overlay.
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.
+1, rn 0.42
from react-native-loading-spinner-overlay.
It crash on release mode
from react-native-loading-spinner-overlay.
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.
Yes, just find commit here: facebook/react-native@5873a22
Trying upgrade to 0.44 now.
from react-native-loading-spinner-overlay.
Closed by facebook/react-native#10845 (comment)
from react-native-loading-spinner-overlay.
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.
@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.
@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.
@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.
Same issue here in "react-native": "0.51.0"
from react-native-loading-spinner-overlay.
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)
- When i navigate to another screen and at that screen i have used spinner but its not working
- After dismissing the spinner, I can't tap on anything HOT 4
- No longer works with RN 0.63.2 HOT 1
- Font Family HOT 3
- Spinner is not staying on screen and may be causing a function to not work. Please help!
- Cancelable Spinner not work HOT 4
- Is it really for React-Native? HOT 1
- Dismissing spinner also dismisses modal HOT 3
- App unresponsive on iOS 15 after enabling then disabling HOT 6
- 2.0.0 to 3.0.0 migration? HOT 34
- Host key verification failed fatal: Could not read from remote repository.
- fixing android navigation bar popping up in apps that don't use it HOT 1
- Animation does not work
- example is missing code for CHILDREN
- can't style the View around the Text
- Need Callback: once completely stops spinner loading, we need one callback function. HOT 1
- in 0.62 it's not working well. HOT 3
- Is it possible to support onPress ? HOT 1
- Spinner is not spinning on specific Android device HOT 2
- Support "statusBarTranslucent" by upgrading to latest react native HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-loading-spinner-overlay.