1

I'm using UI Kitten library for my React Native app UI, and when I add their icon pack the Android app errors, iOS works fine.

Android gets:

Attempt to invoke virtual method `int java.lang.Integer.intValue()` on a null object reference

The App.tsx:

import {EvaIconsPack} from '@ui-kitten/eva-icons';

export default () => (
<>
  <IconRegistry icons={EvaIconsPack} />
  <ApplicationProvider {...eva} theme={{...eva.light, ...theme}}>
    <Layout style={styles.layout}>
      <Button accessoryLeft={<Icon name="facebook" />}>
        Login with Facebook
      </Button>
    </Layout>
  </ApplicationProvider>
</>
);

This line is the problem:

<Icon name="facebook" />

When I remove it and leave the Button as

<Button>
  Login with Facebook
</Button>

Android works again.

android error

Any ideas?

himmip
  • 1,360
  • 2
  • 12
  • 24

1 Answers1

5

Looks like you need to provide a functional component like

<Button accessoryLeft={(props) => (<Icon  {...props} name="facebook" />)}>
Kirill Novikov
  • 2,576
  • 4
  • 20
  • 33