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

ReflectionUtil+ReflectionHelper -- no ahead of time (AOT) code was generated #11524

Closed
unitymatrix opened this issue Jan 11, 2023 · 7 comments
Closed
Assignees
Labels
c# inactive Denotes the issue/PR has not seen activity in the last 90 days. investigation

Comments

@unitymatrix
Copy link

Protobuf Version:3.6.1
Unity3d Version: 2020.2.6
I have checked #5422, #4559.

There is a confusion that the error not always happens,even on the same phone ,with same apk
and I have lots of class like abcConfig.
hot to fix it?

Error_Not_Null:"c# exception:System.TypeInitializationException: The type initializer for 'abcConfigReflection' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ExecutionEngineException: Attempting to call method 'Google.Protobuf.Reflection.ReflectionUtil+ReflectionHelper`2[[System.IntPtr&, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]::.ctor' for which no ahead of time (AOT) code was generated.\n
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 \n
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.ReflectionUtil.GetReflectionHelper (System.Type t1, System.Type t2) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.ReflectionUtil.CreateFuncIMessageObject (System.Reflection.MethodInfo method) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.FieldAccessorBase..ctor (System.Reflection.PropertyInfo property, Google.Protobuf.Reflection.FieldDescriptor descriptor) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.SingleFieldAccessor..ctor (System.Reflection.PropertyInfo property, Google.Protobuf.Reflection.FieldDescriptor descriptor) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.FieldDescriptor.CreateAccessor () [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.FieldDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.MessageDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.FileDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 \n
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 \n
at Google.Protobuf.Reflection.FileDescriptor.FromGeneratedCode (System.Byte[] descriptorData, Google.Protobuf.Reflection.FileDescriptor[] dependencies, Google.Protobuf.Reflection.GeneratedClrTypeInfo generatedCodeInfo) [0x00000] in <00000000000000000000000000000000>:0 \n at BuildingLayoutConfigReflection..cctor () [0x00000] in <00000000000000000000000000000000>:0 \n
at BuildingLayoutConfig.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0 \n at LuaTool.GetConfig (System.String configName) [0x00000] in <00000000000000000000000000000000>:0 \n
at XLua.CSObjectWrap.LuaToolWrap.m_GetConfig_xlua_st (System.IntPtr L) [0x00000] in <00000000000000000000000000000000>:0 \n --- End of inner exception stack trace ---\n
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0 \n
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.ReflectionUtil.GetReflectionHelper (System.Type t1, System.Type t2) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.ReflectionUtil.CreateFuncIMessageObject (System.Reflection.MethodInfo method) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.FieldAccessorBase..ctor (System.Reflection.PropertyInfo property, Google.Protobuf.Reflection.FieldDescriptor descriptor) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.SingleFieldAccessor..ctor (System.Reflection.PropertyInfo property, Google.Protobuf.Reflection.FieldDescriptor descriptor) [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.FieldDescriptor.CreateAccessor () [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.FieldDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.MessageDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 \n
at Google.Protobuf.Reflection.FileDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0 \n
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 \n
at Google.Protobuf.Reflection.FileDescriptor.FromGeneratedCode (System.Byte[] descriptorData, Google.Protobuf.Reflection.FileDescriptor[] dependencies, Google.Protobuf.Reflection.GeneratedClrTypeInfo generatedCodeInfo) [0x00000] in <00000000000000000000000000000000>:0 \n at BuildingLayoutConfigReflection..cctor () [0x00000] in <00000000000000000000000000000000>:0 \n
at BuildingLayoutConfig.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0 \n
at LuaTool.GetConfig (System.String configName) [0x00000] in <00000000000000000000000000000000>:0 \n
at XLua.CSObjectWrap.LuaToolWrap.m_GetConfig_xlua_st (System.IntPtr L) [0x00000] in <00000000000000000000000000000000>:0 \n
--- End of inner exception stack trace ---\n at BuildingLayoutConfig.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0 \n
at LuaTool.GetConfig (System.String configName) [0x00000] in <00000000000000000000000000000000>:0 \n

@unitymatrix unitymatrix added the untriaged auto added to all issues by default when created. label Jan 11, 2023
@jorgbrown jorgbrown added the c# label Jan 14, 2023
@jorgbrown
Copy link
Contributor

Assigning to Jon Skeet for triage.

@jskeet
Copy link
Contributor

jskeet commented Jan 16, 2023

Protobuf Version:3.6.1

Is that definitely the version you mean? That's well over 4 years old. I know there have been various changes that may have fixed that - I'd strongly encourage you to try again with the latest version.

@jskeet jskeet added investigation and removed untriaged auto added to all issues by default when created. labels Jan 16, 2023
@unitymatrix
Copy link
Author

yes 3.6.1~
I have checked the fixed list,there is no modification associated with aot from that version

@unitymatrix
Copy link
Author

#644

3.6.1 is later than this post

@jskeet
Copy link
Contributor

jskeet commented Jan 17, 2023

While other changes may not have mentioned AOT, it's still entirely possible that they've fixed it.

Is there any reason you're reluctant to upgrade to the latest version to test it? (I'd recommend upgrading just for the bug fixes and other improvements over the last 4 years, apart from anything else.)

Copy link

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

@github-actions github-actions bot added the inactive Denotes the issue/PR has not seen activity in the last 90 days. label Dec 11, 2023
Copy link

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c# inactive Denotes the issue/PR has not seen activity in the last 90 days. investigation
Projects
None yet
Development

No branches or pull requests

3 participants