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.

ImageBackground in TouchableNativeFeedback is crashing

See original GitHub issue

Environment

Environment: OS: macOS High Sierra 10.13.3 Node: 9.9.0 Yarn: 1.5.1 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed) react: ^16.3.0-alpha.1 => 16.3.0-alpha.3 react-native: 0.54.2 => 0.54.2

Steps to Reproduce

<TouchableNativeFeedback onPress={() => {console.log('clicked')}}>
  <ImageBackground source={{uri: <url to any image>}} style={{ width: 300, height: 100}} />
</TouchableNativeFeedback>

and try to click it

Expected Behavior

It’ll print “clicked” in logcat

Actual Behavior

It won’t react to a click as expected and crashing with “Trying to send to a non-existing view with a tag <number>” error

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
FlaviooLimacommented, Mar 29, 2018

This only happens in the following case:

<TouchableNativeFeedback>
    <ImageBackground source={require("../image.png")} style={{ width: 300, height: 200 }}>
    </ImageBackground>
</TouchableNativeFeedback>

Hot Fix:

<TouchableNativeFeedback>
    <View>
      <ImageBackground source={require("../image.png")} style={{ width: 300, height: 200 }}>
      </ImageBackground>
    </View>
</TouchableNativeFeedback>

react-native: 0.53.3

1reaction
dulmandakhcommented, Mar 24, 2018

I’m running it on Emulator running Oreo and Samsung S8 running Oreo.

Nesting ImageBackground in TouchableWithoutFeedback and TouchableOpacity, which I chose for workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable highlighting effect of TouchableOpacity when ...
I have a list of TouchableOpacity inside a ScrollView . I want to disable highlighting effect of TouchableOpacity . When scrolling I want...
Read more >
TouchableWithoutFeedback - React Native
If you wish to have several child components, wrap them in a View. Importantly, TouchableWithoutFeedback works by cloning its child and applying ...
Read more >
Image background file causes application to crash without an ...
When an image file is added to a new or existing model as a background, the product crashes without an error message.
Read more >
Geolocation · React Native
... and request the ACCESS_FINE_LOCATION permission using the PermissionsAndroid API. Failure to do so may result in a hard crash.
Read more >
@react-native/assets | Yarn - Package Manager
... instead of crashing the app in hybrid apps (1ca2c24930 by @Kunal-Airtel2022) ... ImageBackground now respects imageStyle width and height (dbd5c3d8e5 by ...
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