我有这个 Xamarin 应用程序,它在调试模式(模拟器和设备)下完美运行。在发布模式(设备)下,应用程序运行良好,直到带有投影查询的 Activity 视图。我删除了链接器配置和代码优化。我进行了一些测试,但该应用程序不适用于基本的投影/过滤选项:
不工作(原始查询。在调试模式下工作但不在发布模式下)
var query = new EntityQuery<TransportReceipt>("GetAllByCustomer");
query = query.WithParameter("customerId", customerId);
作品
var query = new EntityQuery<TransportReceipt>("GetAll");
不工作
var query = new EntityQuery<TransportReceipt>("GetAll").Where(o => o.creationDate > DateTime.Now.AddMonths(-2));
不工作
var query = new EntityQuery<TransportReceipt>("GetAll").Expand(o => o.transportReceiptAttachments);
该图显示了设备日志的副本。
Time Device Name Type PID Tag Message
08-10 09:47:51.520 Samsung SM-J500M Error 967 AndroidRuntime Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
... 1 more
08-10 09:47:51.520 Samsung SM-J500M Error 967 AndroidRuntime Caused by: android.runtime.JavaProxyThrowable: System.TypeInitializationException: The type initializer for 'System.Data.Services.Client.TypeSystem' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
08-10 09:47:51.520 Samsung SM-J500M Error 967 AndroidRuntime FATAL EXCEPTION: main
08-10 09:47:51.520 Samsung SM-J500M Error 967 AndroidRuntime Parameter name: key
at System.ThrowHelper.ThrowArgumentNullException (System.ExceptionArgument argument) [0x00006] in <27d869918d7c4fc687b412573db27626>:0
at System.Collections.Generic.Dictionary`2[TKey,TValue].Insert (TKey key, TValue value, System.Boolean add) [0x00008] in <27d869918d7c4fc687b412573db27626>:0
at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <27d869918d7c4fc687b412573db27626>:0
at System.Data.Services.Client.TypeSystem..cctor () [0x0061b] in <deb764142256426392349c18ced9aa88>:0
--- End of inner exception stack trace ---
at System.Data.Services.Client.ResourceBinder+PatternRules.MatchNonPrivateReadableProperty (System.Linq.Expressions.Expression e, System.Reflection.PropertyInfo& propInfo, System.Linq.Expressions.Expression& target) [0x00033] in <deb764142256426392349c18ced9aa88>:0