Skip to content

Android error when building with Expo #182

Description

@JoshRiser

When trying to build my Expo managed app on Android, I run into the following error:

Attempt to invoke virtual method 'void com.rollbar.android.Rollbar.configure(com.rollbar.notifier.config.ConfigProvider)' on a null object reference'

(same as a closed issue here)

I also found this closed issue, where waltjones gave a solution, which I tried on version 1.0.0-beta.1, 0.9.0 (where there was a PR related to walt's solution,) and 0.9.1 (the version at the time of walt's solution.)

I tried these two configuration options:

const rollbarNative = new Client({
  accessToken: constants.ROLLBAR_KEY,
  environment: 'staging',
  captureUncaught: true,
  captureUnhandledRejections: true,
  captureDeviceInfo: true
});
const rollbar = rollbarNative.rollbar;

and

const config = new Configuration(constants.ROLLBAR_KEY, {
  environment: 'staging',
  captureUncaught: true,
  captureUnhandledRejections: true,
  captureDeviceInfo: true
});
const rollbar = new Client(config);

And neither of them work.

I am also trying to use this configuration with the Provider and ErrorBoundary if that makes a difference.

It all works fine on iOS but Android doesn't want to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions