• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by ChinaZXR · Dec 15, 2015 at 09:57 AM · unity 5iosil2cppaot

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, alt text

... alt text 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...

error.jpg (20.5 kB)
errortwo.jpg (3.9 kB)
Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image

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:

http://stackoverflow.com/questions/5098459/c-sharp-mono-aot-with-protobuf-net-getting-executionengineexception

Comment

People who like this

0 Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ChinaZXR · Dec 17, 2015 at 10:28 AM 0
Share

@JoshPeterson Thank you very much,your answer realy helpful to me.

avatar image allenallenallen ChinaZXR · Dec 17, 2015 at 10:29 AM 0
Share

Remember to use comments if you don't have an answer!!!! Converted to comment.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

This parameter has to be of type: [UNREGISTERED] 0 Answers

I18N.dll and I18N.CJK.dll don't work with IL2CPP 1 Answer

unity 5.2.4 iOS build error ,iOS build error 0 Answers

Unity Build IOS XCODE build error ReentrantLock 0 Answers

What to do with "Undefined symbols for architecture ..." in Xcode for IL2CPP project? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges