- Home /
unity3d(5.3.0f4) app crash on IOS
@JoshPeterson hello,I got a crash when app running on IOS .I use google protocol buffer-port the open source code from github.when use net protocol gennerated by google protocol buffer-port new an object it crashed.The error like this,
... this caused by field in protocol which type is bool when google protocol buffer-port try to call the delegate that get value(CreateUpcastDeletegateImpl) method for field in protocol,but field in protocol which type is string it work fine ,when call CreateUpcastDeletegateImpl ,no error happened.Then I find field in protocol which type is bool,int ,int32,int64...it crashed,but string type work fine.
The Scripting Bankend use IL2CPP,I don't know why field type which is string can find generate AOT code,but int,bool...come out error "no (AOT) code was generated.Can you have some suggestion for me,expecting your answer thank you...
Answer by JoshPeterson · Dec 15, 2015 at 11:55 AM
This is a general problem with C# Ahead-of-time compilers (AOT). The same thing should happen on Mono AOT as well as IL2CPP (although Mono AOT is probably worth a try just to confirm). Both AOT compilers have trouble with generics that have value types (`bool`, int
, etc.) as type arguments. Specifically, the AOT compiler needs to know about the types used at compilation, but serializers like Google Protocol buffers often create types at runtime. The AOT compiler can work with generics that have reference types as arguments (like string
) at runtime, so those fields work.
I'm not specifically familiar with Google Protocol buffers, but a search for "protocol buffers .NET aot" indicates that others have had this same problem. For example, this post might help you:
@JoshPeterson Thank you very much,your answer realy helpful to me.
Remember to use comments if you don't have an answer!!!! Converted to comment.
Your answer
Follow this Question
Related Questions
Unity Build IOS XCODE build error ReentrantLock 0 Answers
What to do with "Undefined symbols for architecture ..." in Xcode for IL2CPP project? 0 Answers
IOS Build settings IL2CPP disabled, Xcode error "Undefined symbol: _UnityPluginUnload" 1 Answer