mixpanel / mixpanel-unity

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

[Mixpanel] System.NotSupportedException: linked away #105

Closed Xii55 closed 2 years ago

Xii55 commented 4 years ago

We have been using mixpanel for a long time works reliable with Unity 2019.2.12f1 UPM: https://github.com/mixpanel/mixpanel-unity.git#v2.1.4 Xcode: 11.4.1 (11E503a) Tested on iOS 13.4.1 iPhone XR The later mentioned log message is does not appear with this version.

However after upgrading to Unity: 2019.4.0f1 Mixpanel: UPM https://github.com/mixpanel/mixpanel-unity.git#v2.2.0 Xcode: 11.4.1 (11E503a) Tested on iOS 13.4.1 iPhone XR

Both version using Scripting Backend: IL2CPP APi compatiblity: .NET 4.x

Update

With this setup the problem is the same. Unity: 2019.4.0f1 UPM: https://github.com/mixpanel/mixpanel-unity.git#v2.1.4 Xcode: 11.4.1 (11E503a) Tested on iOS 13.4.1 iPhone XR

Every FLUSH follows this concerning log message.

[Mixpanel] Dispatching new operation: ENQUEUE_EVENTS
mixpanel.Worker:DispatchOperations()
mixpanel.Worker:RunBackgroundThread()
System.Threading.ThreadStart:Invoke()
System.Threading.ContextCallback:Invoke(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ThreadStart:Invoke()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

[Mixpanel] Dispatching new operation: ENQUEUE_EVENTS
mixpanel.Worker:DispatchOperations()
mixpanel.Worker:RunBackgroundThread()
System.Threading.ThreadStart:Invoke()
System.Threading.ContextCallback:Invoke(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ThreadStart:Invoke()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

[Mixpanel] Dispatching new operation: FLUSH
mixpanel.Worker:DispatchOperations()
mixpanel.Worker:RunBackgroundThread()
System.Threading.ThreadStart:Invoke()
System.Threading.ContextCallback:Invoke(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ThreadStart:Invoke()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

[Mixpanel] System.NotSupportedException: linked away
  at System.Collections.Concurrent.CDSCollectionETWBCLProvider.ConcurrentBag_TryTakeSteals () [0x00000] in <00000000000000000000000000000000>:0 
  at System.Collections.Concurrent.ConcurrentBag`1[T].TrySteal (T& result, System.Boolean take) [0x00000] in <00000000000000000000000000000000>:0 
  at mixpanel.Pool`1[T].Get () [0x00000] in <00000000000000000000000000000000>:0 
  at mixpanel.Worker+<SendData>d__19.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at mixpanel.Worker.DispatchOperations () [0x00000] in <00000000000000000000000000000000>:0 
  at mixpanel.Worker.RunBackgroundThread () [0x00000] in <00000000000000000000000000000000>:0 
  at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
  at System.Threading.ContextCallback.Invoke (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.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
mixpanel.Worker:RunBackgroundThread()
System.Threading.ThreadStart:Invoke()
System.Threading.ContextCallback:Invoke(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ThreadStart:Invoke()
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Result The mixpanel payload does not get uploaded.

Xii55 commented 4 years ago

Related to this https://issuetracker.unity3d.com/issues/android-ios-concurrentbag-dot-trytake-throws-exception-in-il2cpp-build

zihejia commented 2 years ago

We are right now working on a solution to solve all the issues related to IL2CPP, let's use #108 to track. Sorry for the inconvenience.