react-native-mixpanel icon indicating copy to clipboard operation
react-native-mixpanel copied to clipboard

Android Could not invoke RNMixpanel.sharedInstanceWithToken null

Open pjreact opened this issue 6 years ago • 8 comments

Screen Shot 2019-07-02 at 7 24 21 PM

Android Could not invoke RNMixpanel.sharedInstanceWithToken

null

No virtual method getInstanceId()Lcom/google/android/gms/tasks/Task; in class Lcom/google/firebase/iid/FirebaseInstanceId; or its super classes (declaration of 'com.google.firebase.iid.FirebaseInstanceId' appears in /data/app/com.r25g.upliftv2-cVMqx0aibPnCfWmJLn_7_g==/base.apk) invoke JavaMethodWrapper.java:383 invoke JavaModuleWrapper.java:158 run NativeRunnable.java handleCallback Handler.java:789 dispatchMessage Handler.java:98 dispatchMessage MessageQueueThreadHandler.java:29 loop Looper.java:164 run MessageQueueThreadImpl.java:232 run Thread.java:764

pjreact avatar Jul 02 '19 13:07 pjreact

Getting a similar issue:

{ [TypeError: undefined is not a function (evaluating 'RNMixpanel.addPushDeviceToken(token, this.apiToken)')]
  line: 96785,
  column: 45,
  sourceURL: 'http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false' }

dancherb avatar Jul 05 '19 18:07 dancherb

Same issue for me too after upgrading mixpanel to version 1.1.4

Sathyanarayan09 avatar Jul 08 '19 10:07 Sathyanarayan09

I'm using

const mixpanel = new MixpanelInstance(TOKEN)
await mixpanel.initialize()

instead of sharedInstanceWithToken and it works fine

idoamram2gether avatar Jul 11 '19 10:07 idoamram2gether

@idoamram2gether thanks for suggestion. Doesn't work for me unfortunately.

I noticed that if I press "reload" after this error is appeared then everything works fine. So I see this error only on first run of the app (which is still critical though).

EDIT: seems resolved for me. I found this issue in native mixpanel-android package. Maybe comments there may be useful for someone.

In my case I had to add

implementation 'com.google.firebase:firebase-messaging:17.3.4' // Must be higher than 16.2.0

to my app/build.gradle file (I didn't have firebase there at all but for some reason my push notifications were working fine, I have to check this on my end and it's not related to this fix). Actually instruction to add this line is here and README file points to it.

I also added my backend FCM token to mixpanel's application. I didn't test if the fix above works without this token in mixpanel, so I'm not sure if it's required step.

krydos avatar Jul 16 '19 12:07 krydos

My project uses react-native-mixpanel version 1.1.4. I started seeing this error just today when I updated the library to version 1.1.10…

I'm already using implementation 'com.google.firebase:firebase-messaging:17.3.4', and using

const mixpanel = new MixpanelInstance(TOKEN)
await mixpanel.initialize()

instead of sharedInstanceWithToken(TOKEN) does not work: I get another error saying Mixpanel was not initialised.

Forcing version 1.1.4 fixes it for me.

Manhazito avatar Nov 24 '19 18:11 Manhazito

hey guys

I don't know why, I've been developing with this lib for the last two years, and today the bug is happening

My project uses react-native-mixpanel version 1.1.4. I started seeing this error just today when I updated the library to version 1.1.10…

I'm already using implementation 'com.google.firebase:firebase-messaging:17.3.4', and using

const mixpanel = new MixpanelInstance(TOKEN)
await mixpanel.initialize()

instead of sharedInstanceWithToken(TOKEN) does not work: I get another error saying Mixpanel was not initialised.

Forcing version 1.1.4 fixes it for me.

this solution doesn't work, because it's not even provided by this lib, or am I wrong ?

arnaudambro avatar Aug 20 '21 13:08 arnaudambro

Hello there, I've just updated our apps react-native version and starting seeing this one in android(didn't update mixpanel version) image this is the error I'm seeing in release version as well image

this prevents us from updating react native version

OrLevy23 avatar May 08 '23 15:05 OrLevy23

Sorry to hear that, the package has been deprecated for a couple of years. I'd suggest migrating to the official mixpanel sdk.

On Mon, 8 May 2023 at 16:40, Or @.***> wrote:

Hello there, I've just updated our apps react-native version and starting seeing this one in android(didn't update mixpanel version)

this is the error I'm seeing in release version as well

this prevents us from updating react native version

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

davide-scalzo avatar May 08 '23 15:05 davide-scalzo