vovgou / loxodon-framework

An MVVM & Databinding framework that can use C# and Lua to develop games
MIT License
1.86k stars 363 forks source link

切换IOS平台编译报错 #5

Closed lc513623756 closed 3 years ago

lc513623756 commented 4 years ago
系统:macOS Mojave 10.14.4
描述:在Unity 2019.1及2018.4上切换IOS平台有编译错误
Assets/LoxodonFramework/Scripts/Framework/Binding/Reflection/ProxyFieldInfo.cs(134,33): error CS0103: The name 'Expression' does not exist in the current context

Assets/LoxodonFramework/Scripts/Framework/Binding/Reflection/ProxyFieldInfo.cs(135,32): error CS0103: The name 'Expression' does not exist in the current context

Assets/LoxodonFramework/Scripts/Framework/Binding/Reflection/ProxyFieldInfo.cs(136,32): error CS0103: The name 'Expression' does not exist in the current context

Assets/LoxodonFramework/Scripts/Framework/Binding/Reflection/ProxyFieldInfo.cs(137,33): error CS0103: The name 'Expression' does not exist in the current context

Assets/LoxodonFramework/Scripts/Framework/Binding/Reflection/ProxyFieldInfo.cs(138,30): error CS0103: The name 'Expression' does not exist in the current context
错误原因应该是 ENABLE_IL2CPP 没生效 手动配置ENABLE_IL2CPP后编译正常
运行Databinding Tutorials示例 后出现错误
2019-08-16 11:38:22.420 [ERROR] Binding - An exception occurs when the target property is updated.Please check the binding "Text{binding text Expression:vm => Window (Loxodon.Framework.Tutorials.DatabindingExample).localization.GetFormattedText("databinding.tutorials.description", new [] {vm.Account.Username, vm.Username}) Mode:OneWay }" in the view "DatabindingExample[Window]".exception: System.NotSupportedException: Expressions of type System.Object[] are not supported.
  at Loxodon.Framework.Binding.Expressions.ExpressionVisitor.Visit (System.Linq.Expressions.Expression expr) [0x00179] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Expressions/ExpressionVisitor.cs:110 
  at Loxodon.Framework.Binding.Expressions.EvaluatingVisitor.<InvokeMethod>b__7_0 (System.Linq.Expressions.Expression a) [0x00000] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Expressions/EvaluatingVisitor.cs:891 
  at System.Linq.Enumerable+SelectIListIterator`2[TSource,TResult].ToArray () [0x00034] in <1b13ba6391c74847bbc3eddc86df7eee>:0 
  at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <1b13ba6391c74847bbc3eddc86df7eee>:0 
  at Loxodon.Framework.Binding.Expressions.EvaluatingVisitor.InvokeMethod (System.Func`2[T,TResult] invoke, System.Collections.Generic.IEnumerable`1[T] arguments) [0x00001] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Expressions/EvaluatingVisitor.cs:891 
  at Loxodon.Framework.Binding.Expressions.EvaluatingVisitor.VisitMethodCall (System.Linq.Expressions.MethodCallExpression expr) [0x0009f] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Expressions/EvaluatingVisitor.cs:951 
  at Loxodon.Framework.Binding.Expressions.ExpressionVisitor.Visit (System.Linq.Expressions.Expression expr) [0x000fe] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Expressions/ExpressionVisitor.cs:77 
  at Loxodon.Framework.Binding.Expressions.EvaluatingVisitor.Evaluate (System.Linq.Expressions.LambdaExpression expr, Loxodon.Framework.Binding.Expressions.Scope scope, System.Object[] args) [0x0005c] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Expressions/EvaluatingVisitor.cs:996 
  at Loxodon.Framework.Binding.Expressions.EvaluatingVisitor+<>c__DisplayClass13_0.<VisitLambda>b__0 (System.Object[] args) [0x00000] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Expressions/EvaluatingVisitor.cs:971 
  at Loxodon.Framework.Binding.Proxy.Sources.Expressions.ExpressionSourceProxy.GetValue () [0x0000f] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Proxy/Sources/Expressions/ExpressionSourceProxy.cs:59 
  at Loxodon.Framework.Binding.Proxy.Sources.Expressions.ExpressionSourceProxy.GetValue[TValue] () [0x00001] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Proxy/Sources/Expressions/ExpressionSourceProxy.cs:69 
  at Loxodon.Framework.Binding.Binding.<UpdateTargetFromSource>b__25_0 () [0x001c5] in /Users/xxxxx/Documents/workspace_unity/loxodon-framework/Assets/LoxodonFramework/Scripts/Framework/Binding/Binding.cs:302 
UnityEngine.Debug:LogError(Object)
Loxodon.Log.LogImpl:Error(Object) (at Assets/LoxodonFramework/Scripts/Log/DefaultLogFactory.cs:160)
Loxodon.Log.LogImpl:ErrorFormat(String, Object[]) (at Assets/LoxodonFramework/Scripts/Log/DefaultLogFactory.cs:174)
Loxodon.Framework.Binding.Binding:<UpdateTargetFromSource>b__25_0() (at Assets/LoxodonFramework/Scripts/Framework/Binding/Binding.cs:379)
Loxodon.Framework.Execution.Executors:RunOnMainThread(Action, Boolean) (at Assets/LoxodonFramework/Scripts/Framework/Execution/Executors.cs:164)
Loxodon.Framework.Binding.Binding:UpdateTargetFromSource() (at Assets/LoxodonFramework/Scripts/Framework/Binding/Binding.cs:209)
Loxodon.Framework.Binding.Binding:UpdateDataOnBind() (at Assets/LoxodonFramework/Scripts/Framework/Binding/Binding.cs:126)
Loxodon.Framework.Binding.Binding:.ctor(IBindingContext, Object, Object, BindingDescription, ISourceProxyFactory, ITargetProxyFactory) (at Assets/LoxodonFramework/Scripts/Framework/Binding/Binding.cs:76)
Loxodon.Framework.Binding.BindingFactory:Create(IBindingContext, Object, Object, BindingDescription) (at Assets/LoxodonFramework/Scripts/Framework/Binding/BindingFactory.cs:56)
Loxodon.Framework.Binding.Binders.StandardBinder:Bind(IBindingContext, Object, Object, BindingDescription) (at Assets/LoxodonFramework/Scripts/Framework/Binding/Binders/StandardBinder.cs:42)
Loxodon.Framework.Binding.Contexts.BindingContext:Add(Object, BindingDescription, Object) (at Assets/LoxodonFramework/Scripts/Framework/Binding/Contexts/BindingContext.cs:181)
Loxodon.Framework.Binding.Builder.BindingBuilderBase:Build() (at Assets/LoxodonFramework/Scripts/Framework/Binding/Builder/BindingBuilderBase.cs:218)
Loxodon.Framework.Binding.Builder.BindingSetBase:Build() (at Assets/LoxodonFramework/Scripts/Framework/Binding/Builder/BindingSet.cs:50)
Loxodon.Framework.Tutorials.DatabindingExample:Start() (at Assets/LoxodonFramework/Tutorials/Scripts/DatabindingExample.cs:230)Assets/LoxodonFramework/Scripts/Framework/Binding/Reflection/ProxyFieldInfo.cs(138,30): error CS0103: The name 'Expression' does not exist in the current context
vovgou commented 4 years ago

在Unity2018版本,在IOS平台,默认使用IL2CPP时,ENABLE_IL2CPP是无效的,这应该是Unity3d的一个bug,已经改用UNITY_IOS宏来替换,bug已经修复。