Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protobuf got error on iOS #4544

Closed
hoangpham616 opened this issue Apr 23, 2018 · 2 comments
Closed

Protobuf got error on iOS #4544

hoangpham616 opened this issue Apr 23, 2018 · 2 comments

Comments

@hoangpham616
Copy link

I'm using Unity 2017 and Protobuf 3.4
I've got this exception when running on IOS
LoginMessage is class generated by protobuf

ExecutionEngineException: Attempting to call method 'Google.Protobuf.Reflection.ReflectionUtil+ReflectionHelper2[[EndGameInfo, Assembly-CSharp, Version=0.0.0.0, Culture=, PublicKeyToken=null],[System.Int32, mscorlib, Version=4.0.0.0, Culture=, PublicKeyToken=b77a5c561934e089]]::.ctor' for which no ahead of time (AOT) code was generated. at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.ReflectionUtil.GetReflectionHelper (System.Type t1, System.Type t2) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.ReflectionUtil.CreateFuncIMessageObject (System.Reflection.MethodInfo method) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FieldAccessorBase..ctor (System.Reflection.PropertyInfo property, Google.Protobuf.Reflection.FieldDescriptor descriptor) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.SingleFieldAccessor..ctor (System.Reflection.PropertyInfo property, Google.Protobuf.Reflection.FieldDescriptor descriptor) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FieldDescriptor.CreateAccessor () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FieldDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.MessageDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FileDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FileDescriptor.BuildFrom (Google.Protobuf.ByteString descriptorData, Google.Protobuf.Reflection.FileDescriptorProto proto, Google.Protobuf.Reflection.FileDescriptor[] dependencies, System.Boolean allowUnknownDependencies, Google.Protobuf.Reflection.GeneratedClrTypeInfo generatedCodeInfo) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FileDescriptor.FromGeneratedCode (System.Byte[] descriptorData, Google.Protobuf.Reflection.FileDescriptor[] dependencies, Google.Protobuf.Reflection.GeneratedClrTypeInfo generatedCodeInfo) [0x00000] in <00000000000000000000000000000000>:0 at DataReflection..cctor () [0x00000] in <00000000000000000000000000000000>:0 at LoginReflection..cctor () [0x00000] in <00000000000000000000000000000000>:0 at LoginMessage.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message, System.IO.TextWriter writer) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message) [0x00000] in <00000000000000000000000000000000>:0 at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0 at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0 at System.String.Format (System.String format, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0 at NplayNetwork.NetworkManager.Send (XGameCommand cmd, Google.Protobuf.IMessage subMsg) [0x00000] in <00000000000000000000000000000000>:0 at NplayNetwork.LoginMsgHandler.Login (AccountType accountType, System.String openId) [0x00000] in <00000000000000000000000000000000>:0 at LoginScene._OnSocialLoginComplete (ELoginTye loginType, System.Boolean isCancelled, System.String error, System.String openId) [0x00000] in <00000000000000000000000000000000>:0 at LoginScene._OnSocialInitComplete (ELoginTye loginType, System.Boolean isSuccess) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) [0x00000] in <00000000000000000000000000000000>:0
at MyClasses.UI.MyUGUIButton.UnityEngine.EventSystems.IPointerClickHandler.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0 Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.ReflectionUtil.GetReflectionHelper (System.Type t1, System.Type t2) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.ReflectionUtil.CreateFuncIMessageObject (System.Reflection.MethodInfo method) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FieldAccessorBase..ctor (System.Reflection.PropertyInfo property, Google.Protobuf.Reflection.FieldDescriptor descriptor) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.SingleFieldAccessor..ctor (System.Reflection.PropertyInfo property, Google.Protobuf.Reflection.FieldDescriptor descriptor) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FieldDescriptor.CreateAccessor () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FieldDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.MessageDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FileDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FileDescriptor.BuildFrom (Google.Protobuf.ByteString descriptorData, Google.Protobuf.Reflection.FileDescriptorProto proto, Google.Protobuf.Reflection.FileDescriptor[] dependencies, System.Boolean allowUnknownDependencies, Google.Protobuf.Reflection.GeneratedClrTypeInfo generatedCodeInfo) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.Reflection.FileDescriptor.FromGeneratedCode (System.Byte[] descriptorData, Google.Protobuf.Reflection.FileDescriptor[] dependencies, Google.Protobuf.Reflection.GeneratedClrTypeInfo generatedCodeInfo) [0x00000] in <00000000000000000000000000000000>:0 at DataReflection..cctor () [0x00000] in <00000000000000000000000000000000>:0 at LoginReflection..cctor () [0x00000] in <00000000000000000000000000000000>:0 at LoginMessage.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message, System.IO.TextWriter writer) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message) [0x00000] in <00000000000000000000000000000000>:0 at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0 at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0 at System.String.Format (System.String format, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0 at NplayNetwork.NetworkManager.Send (XGameCommand cmd, Google.Protobuf.IMessage subMsg) [0x00000] in <00000000000000000000000000000000>:0 at NplayNetwork.LoginMsgHandler.Login (AccountType accountType, System.String openId) [0x00000] in <00000000000000000000000000000000>:0 at LoginScene._OnSocialLoginComplete (ELoginTye loginType, System.Boolean isCancelled, System.String error, System.String openId) [0x00000] in <00000000000000000000000000000000>:0 at LoginScene._OnSocialInitComplete (ELoginTye loginType, System.Boolean isSuccess) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) [0x00000] in <00000000000000000000000000000000>:0
at MyClasses.UI.MyUGUIButton.UnityEngine.EventSystems.IPointerClickHandler.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0 Rethrow as TypeInitializationException: The type initializer for 'DataReflection' threw an exception. at LoginReflection..cctor () [0x00000] in <00000000000000000000000000000000>:0 at LoginMessage.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message, System.IO.TextWriter writer) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message) [0x00000] in <00000000000000000000000000000000>:0 at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0 at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0 at System.String.Format (System.String format, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0 at NplayNetwork.NetworkManager.Send (XGameCommand cmd, Google.Protobuf.IMessage subMsg) [0x00000] in <00000000000000000000000000000000>:0 at NplayNetwork.LoginMsgHandler.Login (AccountType accountType, System.String openId) [0x00000] in <00000000000000000000000000000000>:0 at LoginScene._OnSocialLoginComplete (ELoginTye loginType, System.Boolean isCancelled, System.String error, System.String openId) [0x00000] in <00000000000000000000000000000000>:0 at LoginScene._OnSocialInitComplete (ELoginTye loginType, System.Boolean isSuccess) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) [0x00000] in <00000000000000000000000000000000>:0
at MyClasses.UI.MyUGUIButton.UnityEngine.EventSystems.IPointerClickHandler.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0 Rethrow as TypeInitializationException: The type initializer for 'LoginReflection' threw an exception. at LoginMessage.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message, System.IO.TextWriter writer) [0x00000] in <00000000000000000000000000000000>:0 at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message) [0x00000] in <00000000000000000000000000000000>:0 at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0 at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0 at System.String.Format (System.String format, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0 at NplayNetwork.NetworkManager.Send (XGameCommand cmd, Google.Protobuf.IMessage subMsg) [0x00000] in <00000000000000000000000000000000>:0 at NplayNetwork.LoginMsgHandler.Login (AccountType accountType, System.String openId) [0x00000] in <00000000000000000000000000000000>:0 at LoginScene._OnSocialLoginComplete (ELoginTye loginType, System.Boolean isCancelled, System.String error, System.String openId) [0x00000] in <00000000000000000000000000000000>:0 at LoginScene._OnSocialInitComplete (ELoginTye loginType, System.Boolean isSuccess) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) [0x00000] in <00000000000000000000000000000000>:0
at MyClasses.UI.MyUGUIButton.UnityEngine.EventSystems.IPointerClickHandler.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0 UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
UnityEngine.EventSystems.StandaloneInputModule:Process()

@hoangpham616
Copy link
Author

I tried to run again and got this error

NullReferenceException: Object reference not set to an instance of an object.
at LoginMessage.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0
at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message, System.IO.TextWriter writer) [0x00000] in <00000000000000000000000000000000>:0
at Google.Protobuf.JsonFormatter.Format (Google.Protobuf.IMessage message) [0x00000] in <00000000000000000000000000000000>:0
at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0
at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0
at System.String.Format (System.String format, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0
at NplayNetwork.NetworkManager.Send (XGameCommand cmd, Google.Protobuf.IMessage subMsg) [0x00000] in <00000000000000000000000000000000>:0
at NplayNetwork.LoginMsgHandler.Login (AccountType accountType, System.String openId) [0x00000] in <00000000000000000000000000000000>:0
at LoginScene._OnSocialLoginComplete (ELoginTye loginType, System.Boolean isCancelled, System.String error, System.String openId) [0x00000] in <00000000000000000000000000000000>:0
at LoginScene._OnSocialInitComplete (ELoginTye loginType, System.Boolean isSuccess) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) [0x00000] in <00000000000000000000000000000000>:0 at MyClasses.UI.MyUGUIButton.UnityEngine.EventSystems.IPointerClickHandler.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
UnityEngine.EventSystems.StandaloneInputModule:Process()

@thomasvl
Copy link
Contributor

This is likely a duplicate of #4320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants