-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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 does not work on iOS build by unity #4320
Comments
@TeBoring all those calls aren't ObjC (we don't have namespace like |
This is a known issue. C# for unity is not yet officially supported. See #644 |
@SausageRoll #3794 was just merged to fix the C# issue on iOS (missing System.Reflection.Emit support). Could you help test it? |
@xfxyjwf Yes, i will do it in soon and write about results |
EDIT: It's working now. Forgot to disable the strip for Google.Protobuf in linker.xml. @xfxyjwf It seems that it's still not working on Unity3D iOS.
|
Any updates on this issue? |
@xfxyjwf @dev-fadzuli Actually, I find the get around way to not use something from System.Reflection.Emit. |
@eye-dee hello,Could you tell me how to solve this problem |
I can't recall now unfortunately. I remember only that for my specific case I was able to use different methods so they don't use |
I am using client-server application with google protobuf on unity and trying to run it on iOS.
I've successfully run it on Windows, MacOS and Android. But can't do it on iOS.
I've got this Exception, when call AuthLoginRequest.Descriptor.
AuthLoginRequest - is class generated by protobuf
NotSupportedException: /Users/builduser/buildslave/unity/build/External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection.Emit/AssemblyBuilder.cpp(20) : Unsupported internal call for IL2CPP:AssemblyBuilder::basic_init - System.Reflection.Emit is not supported. at System.Reflection.Emit.AssemblyBuilder..ctor (System.Reflection.AssemblyName n, System.String directory, System.Reflection.Emit.AssemblyBuilderAccess access, System.Boolean corlib_internal) [0x00000] in <00000000000000000000000000000000>:0 at System.AppDomain.DefineDynamicAssembly (System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access, System.String dir, System.Security.Policy.Evidence evidence, System.Security.PermissionSet requiredPermissions, System.Security.PermissionSet optionalPermissions, System.Security.PermissionSet refusedPermissions, System.Boolean isSynchronized) [0x00000] in <00000000000000000000000000000000>:0 at System.AppDomain.DefineDynamicAssembly (System.Reflection.AssemblyName name, System.Reflection.Emit.AssemblyBuilderAccess access) [0x00000] in <00000000000000000000000000000000>:0 at System.Reflection.Emit.DynamicMethod+AnonHostModuleHolder..cctor () [0x00000] in <00000000000000000000000000000000>:0 at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Reflection.Module m, System.Boolean skipVisibility, System.Boolean anonHosted) [0x00000] in <00000000000000000000000000000000>:0 at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Boolean restrictedSkipVisibility) [0x00000] in <00000000000000000000000000000000>:0 at System.Linq.Expressions.Compiler.LambdaCompiler..ctor (System.Linq.Expressions.Compiler.AnalyzedTree tree, System.Linq.Expressions.LambdaExpression lambda) [0x00000] in <00000000000000000000000000000000>:0 at System.Linq.Expressions.Compiler.LambdaCompiler.Compile (System.Linq.Expressions.LambdaExpression lambda, System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator) [0x00000] in <00000000000000000000000000000000>:0 at System.Linq.Expressions.Expression
1[TDelegate].Compile () [0x00000] in <00000000000000000000000000000000>:0at 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 Com.Aygamesco.P1Server.Common.Network.Packet.LoginReflection..cctor () [0x00000] in <00000000000000000000000000000000>:0
at Com.Aygamesco.P1Server.Common.Network.Packet.AuthLoginRequest.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0
at Connector.Awake () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.GameObject.AddComponent[T] () [0x00000] in <00000000000000000000000000000000>:0
at Connector.get_Instance () [0x00000] in <00000000000000000000000000000000>:0
at InformSystem.FixedUpdate () [0x00000] in <00000000000000000000000000000000>:0
Rethrow as TypeInitializationException: The type initializer for 'System.Reflection.Emit.DynamicMethod.AnonHostModuleHolder' threw an exception.
at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type returnType, System.Type[] parameterTypes, System.Type owner, System.Reflection.Module m, System.Boolean skipVisibility, System.Boolean anonHosted) [0x00000] in <00000000000000000000000000000000>:0
at System.Reflection.Emit.DynamicMethod..ctor (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Boolean restrictedSkipVisibility) [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Expressions.Compiler.LambdaCompiler..ctor (System.Linq.Expressions.Compiler.AnalyzedTree tree, System.Linq.Expressions.LambdaExpression lambda) [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile (System.Linq.Expressions.LambdaExpression lambda, System.Runtime.CompilerServices.DebugInfoGenerator debugInfoGenerator) [0x00000] in <00000000000000000000000000000000>:0
at System.Linq.Expressions.Expression
1[TDelegate].Compile () [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 Com.Aygamesco.P1Server.Common.Network.Packet.LoginReflection..cctor () [0x00000] in <00000000000000000000000000000000>:0 at Com.Aygamesco.P1Server.Common.Network.Packet.AuthLoginRequest.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0 at Connector.Awake () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.GameObject.AddComponent[T] () [0x00000] in <00000000000000000000000000000000>:0 at Connector.get_Instance () [0x00000] in <00000000000000000000000000000000>:0 at InformSystem.FixedUpdate () [0x00000] in <00000000000000000000000000000000>:0 Rethrow as TypeInitializationException: The type initializer for 'Com.Aygamesco.P1Server.Common.Network.Packet.LoginReflection' threw an exception. at Com.Aygamesco.P1Server.Common.Network.Packet.AuthLoginRequest.get_Descriptor () [0x00000] in <00000000000000000000000000000000>:0 at Connector.Awake () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.GameObject.AddComponent[T] () [0x00000] in <00000000000000000000000000000000>:0 at Connector.get_Instance () [0x00000] in <00000000000000000000000000000000>:0 at InformSystem.FixedUpdate () [0x00000] in <00000000000000000000000000000000>:0 UnityEngine.GameObject:AddComponent() Connector:get_Instance() InformSystem:FixedUpdate()
The text was updated successfully, but these errors were encountered: