mixpanel / mixpanel-unity

Official Unity Tracking Library for Mixpanel Analytics
https://mixpanel.com
Apache License 2.0
43 stars 40 forks source link

NullReferenceException on low performance devices #89

Closed OriolZitro closed 2 years ago

OriolZitro commented 4 years ago

Hi,

We are having some issues on low performance devices. We are using the Unity's sdk v2.1.0 (https://github.com/mixpanel/mixpanel-unity/commits/v2.1.0) on our game which will be published on iOS and Android

We think that the principal issue is:

12-11 11:56:04.173 4512-4586/com.zitro.winup D/libc-netbsd: getaddrinfo: api.mixpanel.com get result from proxy gai_error = 0

and the rest of the issues are caused by this one.

As you will be able to see in the two screenshots there is an gai_error at the beginning but the first time that the application is opened (just after it has been installed) there is the error

System.NullReferenceException: Object reference not set to an instance of an object. at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

FirstTimeOpened

And there is an extra error the second time the application is opened

12-11 11:46:28.353 5625-5734/com.zitro.winup E/Unity: [Mixpanel] System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Collections.Generic.Queue`1[T].Dequeue () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 12-11 11:46:32.495 5625-5734/com.zitro.winup E/Unity: [Mixpanel] System.NullReferenceException: Object reference not set to an instance of an object. at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

SecondTimeOpened

We are guessing that there has to be any kind of inconsistency between the local data and the data on the mixpanel's servers

Is this a known issue?

Has anyone been able to fix it?

The Android Model in which this issue is happening is:

Android OS 6.0 / API-23 (MRA58K/1516959587) Android Model bq Aquaris M10 Android Os Version Android OS 6.0 / API-23 (MRA58K/1516959587)

I hope this information helps to identify the issue

Thank you for your help

patedit commented 4 years ago

That's very odd. Does it properly work on the editor and iOS?

Could you please enable debugging on the SDK? (Edit->Project Settings->Mixpanel) and paste here what you see when you track and flush?

Just to confirm, have you modified the tracking URL? In the same settings that I mentioned above, do you see https://api.mixpanel.com/?

OriolZitro commented 4 years ago

Hi,

I am sorry for the delay in my reply, I was on holidays.

It works perfectly on the editor iOS and other Android devices.

We are having that issue on old Android devices:

BQ Aquaris M10 and Nexus 5

We haven't modified any setting on those specific devices and we can see https://api.mixpanel.com/

I have enabled debugging on the SDK and I have got:

FIRST EXECUTION

12-11 11:56:04.100 4512-4586/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=api.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:56:04.102 4512-4586/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=api.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:56:04.122 4512-4512/com.zitro.winup W/MixpanelAPI.ConfigurationChecker: You can't have more than one service handling "com.google.firebase.MESSAGING_EVENT" intent filter. Android will only use the first one that is declared on your AndroidManifest.xml. If you have more than one push provider you need to crate your own FirebaseMessagingService class. 12-11 11:56:04.173 4512-4586/com.zitro.winup D/libc-netbsd: getaddrinfo: api.mixpanel.com get result from proxy gai_error = 0 12-11 11:56:04.173 4512-4586/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=decide.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:56:04.174 4512-4586/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=decide.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:56:04.195 4512-4586/com.zitro.winup D/libc-netbsd: getaddrinfo: decide.mixpanel.com get result from proxy gai_error = 0 12-11 11:56:04.746 4512-4585/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=decide.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:56:04.747 4512-4585/com.zitro.winup I/System.out: [socket][4] connection decide.mixpanel.com/130.211.34.183:443;LocalPort=58692(2000) 12-11 11:56:04.747 4512-4585/com.zitro.winup I/System.out: [CDS]connect[decide.mixpanel.com/130.211.34.183:443] tm:2 12-11 11:56:04.782 4512-4585/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=decide.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:56:05.208 4512-4585/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=api.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:56:05.209 4512-4585/com.zitro.winup I/System.out: [socket][5] connection api.mixpanel.com/130.211.34.183:443;LocalPort=39492(2000) 12-11 11:56:05.209 4512-4585/com.zitro.winup I/System.out: [CDS]connect[api.mixpanel.com/130.211.34.183:443] tm:2 12-11 11:56:05.232 4512-4585/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=api.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:56:28.209 4512-4947/com.zitro.winup E/Unity: [Mixpanel] System.NullReferenceException: Object reference not set to an instance of an object. at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

12-11 11:56:35.593 4512-4947/com.zitro.winup E/Unity: [Mixpanel] System.NullReferenceException: Object reference not set to an instance of an object. at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

12-11 11:56:38.744 4512-4947/com.zitro.winup I/Unity: [Mixpanel] Sending Request - 'https://api.mixpanel.com/track/?ip=1' with payload 'W3siZXZlbnQiOiAiRmlyc3RfT3BlbiIsICJwcm9wZXJ0aWVzIjogeyJJZF9Vc2VyX0lEIjogNTYxOCwgIkxldmVsIjogMSwgIm1wX2xpYiI6ICJ1bml0eSIsICIkbGliX3ZlcnNpb24iOiAiMi4xLjAiLCAiJG9zIjogIkFuZHJvaWQiLCAiJG9zX3ZlcnNpb24iOiAiQW5kcm9pZCBPUyA2LjAgLyBBUEktMjMgKE1SQTU4Sy8xNTE2OTU5NTg3KSIsICIkbW9kZWwiOiAiYnEgQXF1YXJpcyBNMTAiLCAiJGFwcF92ZXJzaW9uX3N0cmluZyI6ICI2LjAuMCIsICIkd2lmaSI6IHRydWUsICIkcmFkaW8iOiAid2lmaSIsICIkZGV2aWNlIjogIkFuZHJvaWQiLCAiJHNjcmVlbl9kcGkiOiAxNjAsICIkc2NyZWVuX3dpZHRoIjogMTI4MCwgIiRzY3JlZW5faGVpZ2h0IjogODAwLCAidG9rZW4iOiAiYWQ0MTg1Mzg4YzA1NTAxMjc1NmQxNDc1YTAzZDk5NGYiLCAiZGlzdGluY3RfaWQiOiAiYmRhZTJlZWMtZGM5ZS00NDgxLTg5ZjktZWFjNjVhZTYyY2Q5IiwgInRpbWUiOiAxNTc2MDYxNzk1LjY2MTk3fSwgIiRtcF9tZXRhZGF0YSI6IHsiJG1wX2V2ZW50X2lkIjogImMyYTYxNjYiLCAiJG1wX3Nlc3Npb25faWQiOiAiMWQ4NjQ5YmEiLCAiJG1wX3Nlc3Npb25fc2VxX2lkIjogMCwgIiRtcF9zZXNzaW9uX3N0YXJ0X3NlYyI6IDE1NzYwNjE3Nzh9fV0=' mixpanel.d__18:MoveNext() mixpanel.Worker:DispatchOperations() mixpanel.W 12-11 11:56:38.786 4512-5001/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=api.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:56:38.791 4512-5001/com.zitro.winup D/libc-netbsd: getaddrinfo: api.mixpanel.com get result from proxy gai_error = 0 12-11 11:56:40.106 4512-4947/com.zitro.winup I/Unity: [Mixpanel] Response - 'https://api.mixpanel.com/track/?ip=1' was '1' mixpanel.d__18:MoveNext() mixpanel.Worker:DispatchOperations() mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

SECOND EXECUTION

12-11 11:46:11.765 5625-5669/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=api.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:46:11.766 5625-5669/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=api.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:46:11.770 5625-5669/com.zitro.winup D/libc-netbsd: getaddrinfo: api.mixpanel.com get result from proxy gai_error = 0 12-11 11:46:11.771 5625-5669/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=decide.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:46:11.772 5625-5669/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=decide.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:46:11.776 5625-5669/com.zitro.winup D/libc-netbsd: getaddrinfo: decide.mixpanel.com get result from proxy gai_error = 0 12-11 11:46:11.782 5625-5625/com.zitro.winup W/MixpanelAPI.ConfigurationChecker: You can't have more than one service handling "com.google.firebase.MESSAGING_EVENT" intent filter. Android will only use the first one that is declared on your AndroidManifest.xml. If you have more than one push provider you need to crate your own FirebaseMessagingService class. 12-11 11:46:11.805 5625-5668/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=decide.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:46:11.806 5625-5668/com.zitro.winup I/System.out: [socket][1] connection decide.mixpanel.com/130.211.34.183:443;LocalPort=57777(2000) 12-11 11:46:11.806 5625-5668/com.zitro.winup I/System.out: [CDS]connect[decide.mixpanel.com/130.211.34.183:443] tm:2 12-11 11:46:11.931 5625-5668/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=decide.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:46:28.353 5625-5734/com.zitro.winup E/Unity: [Mixpanel] System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Collections.Generic.Queue`1[T].Dequeue () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

12-11 11:46:32.495 5625-5734/com.zitro.winup E/Unity: [Mixpanel] System.NullReferenceException: Object reference not set to an instance of an object. at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

12-11 11:46:42.620 5625-5734/com.zitro.winup I/Unity: [Mixpanel] Sending Request - 'https://api.mixpanel.com/track/?ip=1' with payload 'W3siZXZlbnQiOiAiRG93bmxvYWRfQmFja2dyb3VuZF9TdGFydCIsICJwcm9wZXJ0aWVzIjogeyJJZF9Vc2VyX0lEIjogMCwgIkxldmVsIjogMCwgIkV2ZW50X1RpbWUiOiA0Ljg1Mzg2NiwgIm1wX2xpYiI6ICJ1bml0eSIsICIkbGliX3ZlcnNpb24iOiAiMi4xLjAiLCAiJG9zIjogIkFuZHJvaWQiLCAiJG9zX3ZlcnNpb24iOiAiQW5kcm9pZCBPUyA2LjAgLyBBUEktMjMgKE1SQTU4Sy8xNTE2OTU5NTg3KSIsICIkbW9kZWwiOiAiYnEgQXF1YXJpcyBNMTAiLCAiJGFwcF92ZXJzaW9uX3N0cmluZyI6ICI2LjAuMCIsICIkd2lmaSI6IHRydWUsICIkcmFkaW8iOiAid2lmaSIsICIkZGV2aWNlIjogIkFuZHJvaWQiLCAiJHNjcmVlbl9kcGkiOiAxNjAsICIkc2NyZWVuX3dpZHRoIjogMTI4MCwgIiRzY3JlZW5faGVpZ2h0IjogODAwLCAidG9rZW4iOiAiYWQ0MTg1Mzg4YzA1NTAxMjc1NmQxNDc1YTAzZDk5NGYiLCAiZGlzdGluY3RfaWQiOiAiOTJhM2M2YjUtMGEyOC00M2M5LTgzZjAtNDBlNDQ0MTIzNDdiIiwgInRpbWUiOiAxNTc2MDYxMTg4LjMzNzA2fSwgIiRtcF9tZXRhZGF0YSI6IHsiJG1wX2V2ZW50X2lkIjogIjcyZjZkZWI0IiwgIiRtcF9zZXNzaW9uX2lkIjogIjZjMmI0YjZmIiwgIiRtcF9zZXNzaW9uX3NlcV9pZCI6IDAsICIkbXBfc2Vzc2lvbl9zdGFydF9zZWMiOiAxNTc2MDYxMTgyfX1d' mixpanel.d__18:MoveNext() 12-11 11:46:42.667 5625-5781/com.zitro.winup D/libc-netbsd: [getaddrinfo]: hostname=api.mixpanel.com; servname=(null); netid=0; mark=0 12-11 11:46:42.671 5625-5781/com.zitro.winup D/libc-netbsd: getaddrinfo: api.mixpanel.com get result from proxy gai_error = 0 12-11 11:46:44.009 5625-5734/com.zitro.winup I/Unity: [Mixpanel] Response - 'https://api.mixpanel.com/track/?ip=1' was '1' mixpanel.d__18:MoveNext() mixpanel.Worker:DispatchOperations() mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

12-11 11:47:04.985 5625-5734/com.zitro.winup I/Unity: [Mixpanel] Sending Request - 'https://api.mixpanel.com/track/?ip=1' with payload 'W3siZXZlbnQiOiAiTG9hZGVyX1N0YXJ0IiwgInByb3BlcnRpZXMiOiB7IklkX1VzZXJfSUQiOiA1NjE4LCAiTGV2ZWwiOiAxLCAiQXV0aGVudGljYXRpb24iOiAiQW5vbmltbyIsICJFdmVudF9UaW1lIjogMzIuODEzODUyLCAibXBfbGliIjogInVuaXR5IiwgIiRsaWJfdmVyc2lvbiI6ICIyLjEuMCIsICIkb3MiOiAiQW5kcm9pZCIsICIkb3NfdmVyc2lvbiI6ICJBbmRyb2lkIE9TIDYuMCAvIEFQSS0yMyAoTVJBNThLLzE1MTY5NTk1ODcpIiwgIiRtb2RlbCI6ICJicSBBcXVhcmlzIE0xMCIsICIkYXBwX3ZlcnNpb25fc3RyaW5nIjogIjYuMC4wIiwgIiR3aWZpIjogdHJ1ZSwgIiRyYWRpbyI6ICJ3aWZpIiwgIiRkZXZpY2UiOiAiQW5kcm9pZCIsICIkc2NyZWVuX2RwaSI6IDE2MCwgIiRzY3JlZW5fd2lkdGgiOiAxMjgwLCAiJHNjcmVlbl9oZWlnaHQiOiA4MDAsICJ0b2tlbiI6ICJhZDQxODUzODhjMDU1MDEyNzU2ZDE0NzVhMDNkOTk0ZiIsICJkaXN0aW5jdF9pZCI6ICI5MmEzYzZiNS0wYTI4LTQzYzktODNmMC00MGU0NDQxMjM0N2IiLCAidGltZSI6IDE1NzYwNjEyMTUuNTU5NjJ9LCAiJG1wX21ldGFkYXRhIjogeyIkbXBfZXZlbnRfaWQiOiAiM2U5NmZiMmMiLCAiJG1wX3Nlc3Npb25faWQiOiAiNmMyYjRiNmYiLCAiJG1wX3Nlc3Npb25fc2VxX2lkIjogMiwgIiRtcF9zZXNzaW9uX3N0YXJ0X3NlYyI6IDE1NzYwNjExODJ9fV0=' mixpane 12-11 11:47:05.116 5625-5734/com.zitro.winup I/Unity: [Mixpanel] Response - 'https://api.mixpanel.com/track/?ip=1' was '1' mixpanel.d__18:MoveNext() mixpanel.Worker:DispatchOperations() mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

12-11 11:47:55.115 5625-5734/com.zitro.winup E/Unity: [Mixpanel] System.NullReferenceException: Object reference not set to an instance of an object. at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 mixpanel.Worker:RunBackgroundThread() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45)

Thank you for your help, it is greatly appreciated

haim-vrhealth commented 4 years ago

We have the same issue with an android tablet devices. Version 2.1.1

patedit commented 4 years ago

Hey - Does it only happen in physical devices? Wondering if I could emulate this on a simulator. Do you perform any operations on the SDK from multiple threads? When it's the first time in your app lifecycle that you interact with the SDK? Thanks for helping us troubleshoot this!

haim-vrhealth commented 4 years ago

It only happens on the physical device. It is a samsung SM-T595 tablet.

The first time i interact with the SDK is at the startup of the application. I update super properties and track an app launched event. I do call the sdk from different threads but i tested with calling only from the unity main thread and still had the same issue. This is the stack track

01-07 09:37:57.538 26680 26774 E Unity : [Mixpanel] System.NullReferenceException: Object reference not set to an instance of an object. 01-07 09:37:57.538 26680 26774 E Unity : at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 01-07 09:37:57.538 26680 26774 E Unity : at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 01-07 09:37:57.538 26680 26774 E Unity : at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0 01-07 09:37:57.538 26680 26774 E Unity : at System.Threading.ContextCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 01-07 09:37:57.538 26680 26774 E Unity : at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 01-07 09:37:57.538 26680 26774 E Unity : at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 01-07 09:37:57.538 26680 26774 E Unity : at System.Threading.Execution

from adb logcat -s Unity

Thank you!

[https://docs.google.com/uc?export=download&id=1WA_RlIoq8opkw7c6eDoOVcQ3Okrh1NY3&revid=0B4gkDGNaVrvmTnFpbVdsaTAwak0xbHVKVkxQM203UXpWbDY0PQ]

Haim David Senior Unity Developer, Head Of Unity Development

(972) 50-277-0<mailto:(972)%2052-677-3723>600 | haim@vrhealthgroup.commailto:jorge@vrhealthusa.com | http://vrhealthgroup.com/https://www.xr.health/ | 32 Shoken St. Tel-Aviv, Israel, 6105101

[https://docs.google.com/uc?export=download&id=1PWK6FpGIqoSdhS9wYilmO6QYFks9dVhM&revid=0B4gkDGNaVrvmNW45aVhYQ2tSMHAyTkt0R1dIRG55VWV2a1c0PQ]http://facebook.com/VRHealthGroup [https://docs.google.com/uc?export=download&id=1K8Cp6NjllEgprdIQnsEEPF7Dm_O3QQ7N&revid=0B4gkDGNaVrvmVXJFcTZqekl2UFlnNXRxeGVvQ1dtS1hNcEE0PQ] http://twitter.com/VRHealthGroup


From: Sergio Alonso Fernández notifications@github.com Sent: Monday, January 6, 2020 7:42 PM To: mixpanel/mixpanel-unity mixpanel-unity@noreply.github.com Cc: Haim David Haim@vrhealthgroup.com; Comment comment@noreply.github.com Subject: Re: [mixpanel/mixpanel-unity] NullReferenceException on low performance devices (#89)

Hey - Does it only happen in physical devices? Wondering if I could emulate this on a simulator. Do you perform any operations on the SDK from multiple threads? When it's the first time in your app lifecycle that you interact with the SDK? Thanks for helping us troubleshoot this!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/mixpanel/mixpanel-unity/issues/89?email_source=notifications&email_token=AOGFTOBSJ7GVT5TRQPP675DQ4NURPA5CNFSM4J2KITXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIGF5TA#issuecomment-571236044, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOGFTOANCBJKISXGZ5TMOXLQ4NURPANCNFSM4J2KITXA.

haim-vrhealth commented 4 years ago

This is a sample project. It will work in the editor but will send exceptions on android device. IL2CPP backend will always write exceptions. Mono backend will not write exceptions but the events will never show up on the live view dashboard.

AnalyticsMixPanelTest.zip

patedit commented 4 years ago

updating this ticket - would you mind using fix-issue-69 branch and see if it fixes this issue? For that, you can point your manifest.json to that branch like:

"com.mixpanel.unity": "https://github.com/mixpanel/mixpanel-unity.git#fix-issue-69"

thanks a lot folks

haim-vrhealth commented 4 years ago

I have tested this solution with our project and it seems to resolve the issue. Thank you!

OriolZitro commented 4 years ago

Hi,

It is difficult to test if the issue has been fixed, because we need to play the game several times, as the issue is not constant.

We have done a build using that branch and it doesn't seem to fix the issue.

We have tested on a Sony Xperia M4 Aqua (E2303) and we have got

(Filename: ./Runtime/Export/Debug.bindings.h Line: 45) 01-14 11:52:58.600 15346-15598/com.zitro.winup E/Unity: [Mixpanel] System.NullReferenceException: Object reference not set to an instance of an object. at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.Con

There is no

getaddrinfo: api.mixpanel.com get result from proxy gai_error = 0

on this device, so we know that this issue has nothing to do with it.

We don't know what is going on because we can see that there are some events being tracked correctly earlier.

In addition to that, we have tested on a bq Aquaris M10 and there are new System.NullReferenceException

System.NullReferenceException: Object reference not set to an instance of an object. at mixpanel.Mixpanel.Put (mixpanel.Value value) [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.EnqueueMixpanelQueue (mixpanel.queue.PersistentQueue persistentQueue, mixpanel.Value data) [0x00000] in <00000000000000000000000000000000>:0 at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCt

I think that you may be able to replicate the issue if you build a highly demanding application on a low performance device as it just happens on that kind of devices.

Do not hesitate to contact me for further information.

Thank you for your help, it is greatly appreciated.

OriolZitro commented 4 years ago

Hi, is there any advance on this?

Some events are being lost on production, so we are having inconsistent data due to this and we really need to get this fix.

Thank you for your help it is greatly appreciated

Kind regards

haim-vrhealth commented 4 years ago

Originally when I posted this, we ended up going back to an older version of the unity plugin (1.x.x). A month we upgraded again to the latest version and changed the Flush Interval to 1 and we are not encountering this issues any more.

[https://docs.google.com/uc?export=download&id=1WA_RlIoq8opkw7c6eDoOVcQ3Okrh1NY3&revid=0B4gkDGNaVrvmTnFpbVdsaTAwak0xbHVKVkxQM203UXpWbDY0PQ]

Haim David Senior Unity Developer, Head Of Unity Development

(972) 50-277-0<mailto:(972)%2052-677-3723>600 | haim@vrhealthgroup.commailto:jorge@vrhealthusa.com | http://vrhealthgroup.com/https://www.xr.health/ | 32 Shoken St. Tel-Aviv, Israel, 6105101

[https://docs.google.com/uc?export=download&id=1PWK6FpGIqoSdhS9wYilmO6QYFks9dVhM&revid=0B4gkDGNaVrvmNW45aVhYQ2tSMHAyTkt0R1dIRG55VWV2a1c0PQ]http://facebook.com/VRHealthGroup [https://docs.google.com/uc?export=download&id=1K8Cp6NjllEgprdIQnsEEPF7Dm_O3QQ7N&revid=0B4gkDGNaVrvmVXJFcTZqekl2UFlnNXRxeGVvQ1dtS1hNcEE0PQ] http://twitter.com/VRHealthGroup


From: OriolZitro notifications@github.com Sent: Tuesday, June 9, 2020 1:06 PM To: mixpanel/mixpanel-unity mixpanel-unity@noreply.github.com Cc: Haim David haim@xr.health; Comment comment@noreply.github.com Subject: Re: [mixpanel/mixpanel-unity] NullReferenceException on low performance devices (#89)

Hi, is there any advance on this?

Some events are being lost on production, so we are having inconsistent data due to this and we really need to get this fix.

Thank you for your help it is greatly appreciated

Kind regards

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmixpanel%2Fmixpanel-unity%2Fissues%2F89%23issuecomment-641184453&data=02%7C01%7Chaim%40xr.health%7C5158115bec8d4834a08008d80c5cc9b2%7C9bb32a5490ee477f8054971d796fd4ef%7C0%7C0%7C637272939961767243&sdata=31ys%2F4ZRiw6Gr%2FqYY2OVuRe9u%2B4llxbkZtHXnKD0XrE%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAOGFTODLXVGUWZ2LQF3DNNLRVYCSRANCNFSM4J2KITXA&data=02%7C01%7Chaim%40xr.health%7C5158115bec8d4834a08008d80c5cc9b2%7C9bb32a5490ee477f8054971d796fd4ef%7C0%7C0%7C637272939961767243&sdata=uukVMQWs0FR7Jjp2RPrwGWyLjBu5JA16ShMyQY20k9Q%3D&reserved=0.

OriolZitro commented 4 years ago

Thank you so much for your response, we will update the sdk version to the last version and change the Flush interval.

Is the version 2.20 (https://github.com/mixpanel/mixpanel-unity/commits/v2.20) the one that is working for you?

Thanks

haim-vrhealth commented 4 years ago

No. 2.2.0 was released 6 days ago. we are using 2.1.4.

[https://docs.google.com/uc?export=download&id=1WA_RlIoq8opkw7c6eDoOVcQ3Okrh1NY3&revid=0B4gkDGNaVrvmTnFpbVdsaTAwak0xbHVKVkxQM203UXpWbDY0PQ]

Haim David Senior Unity Developer, Head Of Unity Development

(972) 50-277-0<mailto:(972)%2052-677-3723>600 | haim@xmailto:jorge@vrhealthusa.comr.health | http://vrhealthgroup.com/https://www.xr.health/ | 32 Shoken St. Tel-Aviv, Israel, 6105101

[https://docs.google.com/uc?export=download&id=1PWK6FpGIqoSdhS9wYilmO6QYFks9dVhM&revid=0B4gkDGNaVrvmNW45aVhYQ2tSMHAyTkt0R1dIRG55VWV2a1c0PQ]http://facebook.com/VRHealthGroup [https://docs.google.com/uc?export=download&id=1K8Cp6NjllEgprdIQnsEEPF7Dm_O3QQ7N&revid=0B4gkDGNaVrvmVXJFcTZqekl2UFlnNXRxeGVvQ1dtS1hNcEE0PQ] http://twitter.com/VRHealthGroup


From: OriolZitro notifications@github.com Sent: Tuesday, June 9, 2020 1:30 PM To: mixpanel/mixpanel-unity mixpanel-unity@noreply.github.com Cc: Haim David haim@xr.health; Comment comment@noreply.github.com Subject: Re: [mixpanel/mixpanel-unity] NullReferenceException on low performance devices (#89)

Thank you so much for your response, we will update the sdk version to the last version and change the Flush interval.

Is the version 2.20 (https://github.com/mixpanel/mixpanel-unity/commits/v2.20https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmixpanel%2Fmixpanel-unity%2Fcommits%2Fv2.20&data=02%7C01%7Chaim%40xr.health%7Cd2e4289ad22048173b0608d80c601e2b%7C9bb32a5490ee477f8054971d796fd4ef%7C0%7C0%7C637272954247230553&sdata=7zUGdGSlA9XnA0mRgVo4mSpThOQy%2Ba0o2ONKMMFm1hA%3D&reserved=0) the one that is working for you?

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmixpanel%2Fmixpanel-unity%2Fissues%2F89%23issuecomment-641198326&data=02%7C01%7Chaim%40xr.health%7Cd2e4289ad22048173b0608d80c601e2b%7C9bb32a5490ee477f8054971d796fd4ef%7C0%7C0%7C637272954247240516&sdata=zA7U8bh5xK3WyWStTIAly0CE%2FT7QWZZ9Ota%2F1HJAA48%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAOGFTOBBGBJRZHFBP347E7TRVYFL3ANCNFSM4J2KITXA&data=02%7C01%7Chaim%40xr.health%7Cd2e4289ad22048173b0608d80c601e2b%7C9bb32a5490ee477f8054971d796fd4ef%7C0%7C0%7C637272954247240516&sdata=wKBVi0rvqaXJCsau5hJap0l2fT%2BRSjqs4z2L2qT1Tjw%3D&reserved=0.

OriolZitro commented 4 years ago

Our QA team has tested our application using 2.1.4 and setting the flush interval to 10 and it seems to be working well. You (@haim-vrhealth) may want to test if setting the flush interval still works for you as this will save battery for your users.

I guess that you could close the issue.

Thank you so much to both of you for your help, it is greatly appreciated

Best