Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by Jean-Fabre · Feb 11, 2013 at 05:08 AM · iosmonobehaviourlinkstripping

link.xml for a monobehaviour?

Hi,

I have basically a monobehaviour and I use reflection to access one of it's getter, and it fails to work on IOS when stripping.. so I would like a confirmation that this link.xml is properly formatted and the problem would then be elsewhere.

What is the correct link.xml content for a monobehaviour then?

The error I get is:

 Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method 'System.Reflection.MonoProperty:GetterAdapterFrame<PlayMakerThirdPersonControllerProxy, int> (System.Reflection.MonoProperty/Getter`2<PlayMakerThirdPersonControllerProxy, int>,object)' while running with --aot-only.
 
   at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00000] in <filename unknown>:0
   at HutongGames.PlayMaker.ReflectionUtils.GetMemberValue (System.Reflection.MemberInfo member, System.Object target) [0x00000] in <filename unknown>:0
   at HutongGames.PlayMaker.ReflectionUtils.GetMemberValue (System.Reflection.MemberInfo[] memberInfo, System.Object target) [0x00000] in <filename unknown>:0
   at HutongGames.PlayMaker.FsmProperty.GetValue () [0x00000] in <filename unknown>:0 

thanks,

Jean

Comment
Add comment · Show 10
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 Bovine · Feb 11, 2013 at 06:20 AM 0
Share

What stripping level are you using? The highest level breaks reflection I believe.

What do you mean by link.xml?

What's the use-case for using reflection? Is it a private getter you're accessing? Is it on the $$anonymous$$onoBevahior class or you subclass or another super?

avatar image Jean-Fabre · Feb 11, 2013 at 06:36 AM 0
Share

Hi Bovine. I am using a normal behavior public variable, no fancyness here. I am using Play$$anonymous$$aker to access that behavior public property, that's why I need reflection. link.xml is suppose to allow for reflection... http://docs.unity3d.com/Documentation/$$anonymous$$anual/iphone-playerSizeOptimization.html

avatar image Bovine · Feb 11, 2013 at 06:49 AM 0
Share

Ahh, I didn't know you could do that. A daft question but are you white-listing the right class? Do you need to add all super classes, what about subclasses? I don't know how it works, so perhaps you need the complete list?

Either way you could experiment by simplifying the case - in a new temp project link Play$$anonymous$$aker to a getter on a class you have created and see if that simple case works with stripping and your whitelist.

If it does, subclass your class and see if it still works without changing the white list.

The type being inspected is key I suspect, so if it does work, then have Play$$anonymous$$aker link with your subclass and see if that works without changing the whitelist?

avatar image Jean-Fabre · Feb 11, 2013 at 07:05 AM 0
Share

maybe, but the question is really about knowing what exactly is the content of link.xml when I want to white list a monobehaviour. Currently I can't find anything on the web that clearly shows a working example using a monobehaviour...

avatar image Graham-Dunnett ♦♦ · Feb 11, 2013 at 11:05 AM 0
Share

What's the code that you are trying to use?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Graham-Dunnett · Feb 11, 2013 at 11:04 AM

link.xml allows you to tell the stripper that certain .NET features should not be removed. It's not really related to reflection in any way, just use of reflection is something the stripper doesn't know about. It should not be needed if you are just using regular MonoBehaviour things.

Also, bear in mind that reflection usually requires code to be generated and compiled at runtime. Runtime code-generation is not supported on iOS devices.

Comment
Add comment · Show 1 · 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 Bovine · Feb 11, 2013 at 11:45 AM 0
Share

@Graham Dunnet while you cannot have runtime generated code on iOS devices you can still use generics - I believe mono pre-compiles variations of code to get around this, but I don't pretend to understand the problem, so much as the solution, here's the problem or discussion about trampolines at least:

http://www.mono-project.com/$$anonymous$$ono:Runtime:Documentation:Trampolines

Here's the solution (see iOS section):

http://docs.unity3d.com/Documentation/$$anonymous$$anual/TroubleShooting.html

We use the following AOT settings:

lines=8192,ntrampolines=8192-trampolines=8192,ntrampolines=8192

The upshot for us is that we strip to byte code level and increase the size of our trampoline pool. Naturally there is some memory cost associated with this, but thus far it hasn't proved a problem - we are already WAY over 20$$anonymous$$B anyway :D

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.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

IOS : Which parts of the System namespace can you use with ' micro mscorlib' stripping 1 Answer

Breaking Links intentionally at Build 2 Answers

How to link to my app in the app store 2 Answers

Cannot Build for iOS Platform 0 Answers

HTTP WebRequest with iOS Stripping 1 Answer


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