(Android) Trying to resolve view with tag which doesn't exist

See original GitHub issue

I’m getting this issue if my view reference did not specify a backgroundColor.

so the code works fine if I take a Snapshot with the below viewRef

<View   
  style={{backgroundColor: 'yellow'}}   
  ref={ref => viewRefSuccess = ref}>   
  <Text>   
    Hello View Snap Shot   
  </Text>   
</View>   

However it will crash with the “Trying to resolve view with tag ‘tagID’ which doesn’t exist” if I remove the backgroundColor props.

<View ref={ref => viewRefSuccess = ref}>   
  <Text>   
    Hello View Snap Shot   
  </Text>   
</View>   

Any thought on why this is happening?

Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:14
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

68reactions
gaguirrecommented, Sep 7, 2016

Probably related to the collapsable property for Android Views. Setting it to false could fix the problem.

54reactions
manivannan-mpcommented, Aug 14, 2019

Resolved by adding collapsable={false} to view

<View collapsable={false} style={{backgroundColor: 'yellow'}} ref={ref => viewRefSuccess = ref}> <Text> Hello View Snap Shot </Text> </View>

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make Expo.takeSnapshotAsync work on Android
This works fine on the iOS simulator but on Andriod, I get a red screen error: Trying to resolve view with tag 488...
Read more >
Troubleshooting | React Navigation
Troubleshooting. This section attempts to outline issues that users frequently encounter when first getting accustomed to using React Navigation.
Read more >
react-native-view-shot - npm
Start using react-native-view-shot in your project by running `npm i ... "Trying to resolve view with tag '{tagID}' which doesn't exist".
Read more >
View - Android Developers
FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException...
Read more >
View - React Native
pointerEvents ​ ... Controls whether the View can be the target of touch events. ... Since pointerEvents does not affect layout/appearance, and we ......
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