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
1
Question by NeilMonday · Sep 26, 2010 at 09:33 PM · javascriptiphone

ExecutionEngineException: Unity 3 on the iPhone

Hello all,

I am having some weird behavior in my game when it is running on a device. The game works just fine when it is running inside of the editor with UnityRemote. However, when I build and run the game on the iPad it starts fine and then when it gets to this one function, I get this error in the Xcode console:

ExecutionEngineException: Attempting to JIT compile method '(wrapper dynamic-method) Boo.Lang.Runtime.RuntimeServices:RuntimeServices$op_Addition$System.String$UnityEngine.Vector3 (object,object[])' while running with --aot-only.

at System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00000] in <filename unknown>:0 at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) [0x00000] in <filename unknown>:0 at System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method) [0x00000] in <filename unknown>:0 at System.Reflection.Emit.DynamicMethod.CreateDelegate (System.Type delegateType) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.DynamicDispatching.Emitters.DispatcherEmitter.CreateMethodDispatcher () [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.DynamicDispatching.Emitters.DispatcherEmitter.Emit () [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.EmitMethodDispatcher (Boo.Lang.Runtime.CandidateMethod found, System.Type[] argumentTypes) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.Create () [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices.DoCreateMethodDispatcher (System.Object target, System.Type targetType, System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices.CreateMethodDispatcher (System.Object target, System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices+<Invoke>c_AnonStorey13.<>m_7 () [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Object[] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices.Invoke (System.Object target, System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices.InvokeRuntimeServicesOperator (System.String operatorName, System.Object[] args) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator (System.String operatorName, System.Object lhs, System.Object rhs) [0x00000] in <filename unknown>:0 at CustomTapControl.BlockControl () [0x00000] in <filename unknown>:0 at CustomTapControl.Update () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

Here is the BlockControl function that it mentions in the error.

function BlockControl() { var hitPoint;

var count : int = iPhoneInput.touchCount;
if( count == 1 && state == ControlState.MovingBlock ) { var touch : iPhoneTouch = iPhoneInput.GetTouch(0); var screenRay = cam.ScreenPointToRay( Vector3( touch.position.x, touch.position.y ) );

 var touchHit : RaycastHit;
 if( Physics.Raycast(screenRay, touchHit, 10000, touchLayerMask) )
 {
     hitPoint = touchHit.point;

     var movementVector : Vector3;
     if(latchedBlock.transform.position.x != latchedBlock.transform.parent.transform.position.x)
     {
         if(hitPoint.x &gt; latchedBlock.transform.parent.transform.position.x)
         {
             movementVector = Vector3(1,0,0);
         }
         else
         {
             movementVector = Vector3(-1,0,0);
         }
     }
     else if(latchedBlock.transform.position.z != latchedBlock.transform.parent.transform.position.z)
     {
         if(hitPoint.z &gt; latchedBlock.transform.parent.transform.position.z)
         {
             movementVector = Vector3(0,0,1);
         }
         else
         {
             movementVector = Vector3(0,0,-1);
         }
     }               

     if(latchedBlock != null)
     {
         var ray : Ray;
         ray.origin = latchedBlock.transform.parent.transform.position;
         ray.direction = movementVector;

         var hit : RaycastHit;
         if (Physics.Raycast (ray, hit, 100, freeSpaceMask)) {

             startBlockTransform = latchedBlock.transform.parent.transform;
             targetTransform = hit.transform;
             state = ControlState.WaitingForBlockMovement;
         }
     }
 }

} }

I am using Unity 3.0.0f4 iPhone Basic. I have tried .NET 2.0 Subset and regular .NET 2.0. Also, I have tried armv7 and v6 and then just armv6 only. I have a feeling that the problem is the way that I am constructing a Vector3 object, but I really have no idea. Any help is greatly appreciated.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Peter G · Sep 27, 2010 at 12:34 AM

You have to explicitly state the type of your variables. The standalone let's unity use dynamic typing, but everything has to be statically typed in iPhone. The first example I see is:

var hitPoint;

so change that to:

var hitPoint : Vector2;

and any other examples like that, and you should be good to go.

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 NeilMonday · Oct 03, 2010 at 11:49 PM 0
Share

Thanks, that fixed it.

avatar image
1

Answer by Dreamora · Sep 27, 2010 at 12:52 AM

aside of that the code just has errors. you have a Vector3( ... ) in the raycast function but only provide 2 values and things like that.

Unity iPhone 1.7 and mono 1.2.5 were much more forgiving on broken code. Good thing is that getting errors thrown right out will help you write correct code in the first place

also, adding

#pragma strict
#pragma implicit
#pragma downcast

at the top of each unitscript file can save you quite a bit of time cause errors will appear then in the editor normally not post build on the device.

Comment
Add comment · 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

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

No one has followed this question yet.

Related Questions

How to support Retina display 1 Answer

How do I invert the Y axis in Penelope tutorial? 3 Answers

A node in a childnode? 1 Answer

Make objects easier to select 1 Answer

Unity iPhone and Unity Desktop Scripting Differences 2 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