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.

Header crashes on Android.

See original GitHub issue

Explain what you did Use header component. Used most basic example. Experiencing instant force close on Android, no error. Just closes. Works on ios.

Expected behaviour That I can use the example header component. <Header leftComponent={{ icon: 'menu', color: '#fff' }} centerComponent={{ text: 'MY TITLE', style: { color: '#fff' } }} rightComponent={{ icon: 'home', color: '#fff' }} />

Describe the bug App crashes instantly. I’ve also attempted to use an example I found in a previous issue from here. <Header innerContainerStyles={{flexDirection: 'row'}} backgroundColor='#f40057' > <Avatar small rounded source={{uri: "http://www.usanetwork.com/sites/usanetwork/files/styles/629x720/public/2016/07/mrrobot_s2_cast_rami-malek2.jpg"}} onPress={() => this.goToProfileDetail()} activeOpacity={0.7} /> <View style={{alignItems: 'center'}}> <Text style={{justifyContent: 'center', color: '#fff', alignContent:'center'}}>Eliot Alderson</Text> <Text style={{justifyContent: 'center', color: '#fff'}}>eliot@food.com.br</Text> </View> <Icon name={'settings-applications'} color={'#fff'} onPress={() => this.goToProfileDetail()} /> </Header>

Results in the same crash. If I take the header component out everything runs properly. Relatively fresh project build. I have the following packages : "react": "16.8.3", "react-native": "0.59.9", "react-native-clean-project": "^3.2.1", "react-native-elements": "^1.1.0", "react-native-firebase": "^5.5.4", "react-native-gesture-handler": "^1.3.0", "react-native-vector-icons": "^6.6.0", "react-navigation": "^3.11.0"

Your Environment (please complete the following information):

software version
react-native-elements 1.1.0
react-native 0.59.9
npm or yarn 6.9.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
lpikoracommented, Sep 29, 2019

@RobertSasak I have this in my code:

<Avatar
  overlayContainerStyle={{
    backgroundColor: config.themeColors.userAvatarBackgroundColor
  }}
  size={size}
  rounded
  title={firstName.charAt(0) + lastName.charAt(0)}
  source={
    Platform.OS === 'android'
      ? require('../../assets/img/1transparentpixel.png')
      : null
  } // Without source it crashes on Android 5.1
/>

With Header component, it should be like:

 <Header backgroundImage={require('../../assets/img/1transparentpixel.png')}
0reactions
issamabdelkrimcommented, Nov 6, 2019

in the header component add this : ViewComponent={View }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android add header in Navigation drawer causes app crash
I'm trying to use a navigation drawer in my app like the g+ one, with separator headers and a list of items, but...
Read more >
Diagnosing Native Crashes | Android Open Source Project
The following sections include common types of native crash, an analysis of a sample crash dump, and a discussion of tombstones.
Read more >
App crashes when item marked as sticky header is not the first ...
Hello team, I'm trying to implement this Sticky Headers newly added feature and I'm getting a crash when the item I want as...
Read more >
Crash when NavigationView menu item or header view ...
Steps to Reproduce: 1. Add an xml "onClick" attribute to a menu item or to a header layout. 2. Add that menu or...
Read more >
Xamarin form app is Crashing in Android device - Microsoft Q&A
I am using Xamarin community toolkit Media element in my application to play and download video . I am getting Runtime exception in...
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