Skip to content

NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationC... #83

Description

@mustvlad
NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
    at com.ironsource.mediationsdk.IronSourceObject.init(IronSourceObject.java:257)
    at com.ironsource.mediationsdk.IronSource.init(IronSource.java:86)
    at com.ironsource.mediationsdk.IronSource.init(IronSource.java:75)
    at co.squaretwo.ironsource.RNIronSourceModule$1.run(RNIronSourceModule.java:40)
    at android.os.Handler.handleCallback(Handler.java:938)
...
(6 additional frame(s) were not displayed)

Hi guys,

We're having this issue on Android and could not understand where is coming from.
This seem to be something at the moment of the initialization of the SDK.

// Set Iron Source consent
IronSource.setConsent(consent);

// Init IronSource SDK
const ISUserId = this.props.loggedIn ? 
  this.props.session.user_id : 
  (devicePushToken ? devicePushToken.data : "random-user");

const ISAppKey = Platform.OS === "android" ? 
  "xxxxxxxx" : 
  "xxxxxxxx";

await IronSource.initializeIronSource(ISAppKey, ISUserId, {
  validateIntegration: true,
});

This is how we're doing the init. Also this issue happens only to some users but we couldn't replicate it ourselves.

Any ideas?

Cheers'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions