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?

1
  • 1
    can you try <Button accessoryLeft={(props) => (<Icon {...props} name="facebook" />)}> Commented Oct 24, 2022 at 18:22

1 Answer 1

5

Looks like you need to provide a functional component like

<Button accessoryLeft={(props) => (<Icon  {...props} name="facebook" />)}>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.