Unity 2017.3 Android IL2CPP ArgumentNullException

Hello, I’m using too many external libraries in my project to check what causes this error and I can’t figure out where this error actually comes from. Please help. :slight_smile:
It works fine with Mono, but with IL2CPP this happens:

01-12 15:44:00.330: E/Unity(13561): ArgumentNullException: Value cannot be null.
01-12 15:44:00.330: E/Unity(13561): Parameter name: method
01-12 15:44:00.330: E/Unity(13561):   at System.Dynamic.Utils.ContractUtils.RequiresNotNull (System.Object value, System.String paramName) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.330: E/Unity(13561):   at System.Linq.Expressions.Expression.Call (System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.330: E/Unity(13561):   at System.Runtime.CompilerServices.CallSite`1[T].CreateCustomNoMatchDelegate (System.Reflection.MethodInfo invoke) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.330: E/Unity(13561):   at System.Runtime.CompilerServices.CallSite`1[T].MakeUpdateDelegate () [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.330: E/Unity(13561):   at System.Runtime.CompilerServices.CallSite`1[T].GetUpdateDelegate (T& addr) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.330: E/Unity(13561):   at System.Runtime.CompilerServices.CallSite`1[T]..ctor (System.Runtime.CompilerServices.CallSiteBinder binder) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.330: E/Unity(13561):   at System.Runtime.CompilerServices.Cal
01-12 15:44:00.340: E/Unity(13561): ArgumentNullException: Value cannot be null.
01-12 15:44:00.340: E/Unity(13561): Parameter name: method
01-12 15:44:00.340: E/Unity(13561):   at System.Dynamic.Utils.ContractUtils.RequiresNotNull (System.Object value, System.String paramName) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.340: E/Unity(13561):   at System.Linq.Expressions.Expression.Call (System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.340: E/Unity(13561):   at System.Runtime.CompilerServices.CallSite`1[T].CreateCustomNoMatchDelegate (System.Reflection.MethodInfo invoke) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.340: E/Unity(13561):   at System.Runtime.CompilerServices.CallSite`1[T].MakeUpdateDelegate () [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.340: E/Unity(13561):   at System.Runtime.CompilerServices.CallSite`1[T].GetUpdateDelegate (T& addr) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.340: E/Unity(13561):   at System.Runtime.CompilerServices.CallSite`1[T]..ctor (System.Runtime.CompilerServices.CallSiteBinder binder) [0x00000] in <00000000000000000000000000000000>:0 
01-12 15:44:00.340: E/Unity(13561):   at System.Runtime.CompilerServices.Cal

So it seems that you cannot use dynamic with IL2CPP.

@JoshPeterson Is this still true (jan '19)? What’s the alternative?
This is my situation (ios 12, Unity 2017, il2cpp):

 public static class PortConverter
    {	public static void Convert(float a, int b)
    	{
    		Debug.Log("called the typed convert");
    	}
    }
    public class Porto<T, M>
    {
    	T a;
    	M b;
    	public Porto(T _a, M _b)
    	{
    		a = _a;		b = _b;
    	}
    	public void doThat()
    	{
    		PortConverter.Convert((dynamic)a, (dynamic)b);
    	}
    }
    public class lala : MonoBehaviour {
    	Porto<float, int>  a = new Porto<float, int>(1.0f,2);
    
    	void OnEnable () {
    		a.doThat(); 
    	}
    }

That fails in what seems like the call to dynamic, is there a way around? Is there support for dynamic in the horizon?

thanks!