davide-scalzo / react-native-mixpanel

A React Native wrapper for Mixpanel tracking
MIT License
455 stars 195 forks source link

Android release build error on v1.1.14 RNMixpanel.sharedInstanceWithToken got 3 arguments, expected 4 #218

Open matt-dalton opened 4 years ago

matt-dalton commented 4 years ago

When I try and create a release build using react-native run-android --variant=release, the app builds successfully, but then when I open it on the simulator I get:

E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.finimize.myapp, PID: 23809
    com.facebook.react.bridge.NativeArgumentsParseException: RNMixpanel.sharedInstanceWithToken got 3 arguments, expected 4
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:348)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
        at android.os.Looper.loop(Looper.java:193)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)
        at java.lang.Thread.run(Thread.java:764)

Library version 1.1.14, RN version 0.61.5 The Android gradle dependency tells me I'm using this version com.mixpanel.android:mixpanel-android:5.6.8@aar

I've tested this on someone else's machine too and the same issue.

JacquesBonet commented 4 years ago

I have same problem.

JacquesBonet commented 4 years ago

Its ok in removing metro cache file

enigmablue commented 4 years ago

@matt-dalton how did you fix it ? if you have

JacquesBonet commented 4 years ago

you have a metro-cache directory under the tmp directory of your operating system.

Remove this metro-cache file and rebuid.

ghasemikasra39 commented 4 years ago

TypeError: Mixpanel.sharedInstanceWithToken is not a function

leotm commented 4 years ago

Same here upgrading from 1.1.1 to 1.2.0, going to downgrade, since I've have checked/followed these as far as I can tell

Debug-mode is not an issue, only release-mode builds too

RN 0.61.5 too


Screenshot 2020-07-09 at 19 43 35
matt-dalton commented 3 years ago

@matt-dalton how did you fix it ? if you have

Sorry @enigmablue - didn't see this. I'm still having problems with it. It just only seems to affect release builds on my simulator, so have just been building on device until now.

you have a metro-cache directory under the tmp directory of your operating system.

Remove this metro-cache file and rebuid.

I tried this: rm -rf $TMPDIR/metro-*

And rebuilt and it didn't seem to fix anything.

Has anyone else managed to work this out?