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 theBrandonWu · Feb 07, 2011 at 11:29 PM · javascriptiphonexcode

ExecutionEngineException: Attempting to JIT compile method.. (Unity 3, iPhone) with MessageList

I am having some problem with running the game on the iPhone. The game runs fine in the editor, and it ran fine on the iPhone when I was still using Unity 1.7. However since I upgraded to Unity 3, I have been seeing this error whenever I use MessageList from Unity Wiki (http://www.unifycommunity.com/wiki/index.php?title=MessageList).

Unloading 81 unused Assets to reduce memory usage. Loaded Objects now: 563. Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0) ExecutionEngineException: Attempting to JIT compile method '(wrapper dynamic-method) UnityEngine.Object:Object$op_Implicit (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.RuntimeServices.EmitImplicitConversionDispatcher (System.Reflection.MethodInfo method) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices.CreateBoolConverter (System.Type type) [0x00000] in <filename unknown>:0 at Boo.Lang.Runtime.RuntimeServices+<ToBool>c_AnonStorey1E.<>m_15 () [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.ToBool (System.Object value) [0x00000] in <filename unknown>:0 at MessageList.AddMessage (System.String messageText) [0x00000] in <filename unknown>:0 at Dialog_cutscene_1_0+$DisplayMessages$1056+$.MoveNext () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

And here's the code for MessageList:

// MessageList.js // From the Unity Wiki // Use with TimedFadeText.js // Attach to an emtpy Game Object

var messagePrefab : GUIText; // The prefab for our text object

var lineSize : float = 20.0; // The pixel spacing between text objects var startPos : Vector3 = Vector3 (20, 20, 0); // The position GUIText objects will be instantiated var layerTag : int = 0; var insertAbove : boolean = true;

private var messages = new Array(); // The array that holds all our text objects private var directionFactor : float = 1.0;

// Provide singleton support for this class. // The script must still be attached to a game object, but this will allow it to be called // from anywhere without specifically identifying that game object. static private var messageListInstance : MessageList; static var instance : MessageList;

static function Instance () { if (!instance) { instance = FindObjectOfType (MessageList); if (!instance) Debug.LogError ("There needs to be one active MessageList script on a GameObject in your scene."); } return instance; }

function Awake () { // First make sure that we have a prefab set. If not, then disable the script if (!messagePrefab) { enabled = false; Debug.Log("Must set the GUIText prefab for MessageList"); }

 if (insertAbove) {
     directionFactor = 1.0;
 }

 else {
     directionFactor = -1.0;
 }

}

// AddMessage() accepts a text value and adds it as a status message. // All other status messages will be moved along the y axis by a normalized distance of lineSize. // AddMessage() also handles automatic removing of any GUIText objects that automatically destroy // themselves. function AddMessage (messageText : String) { // Itterate through the messages, removing any that don't exist anymore, and moving the rest for (var i = 0; i < messages.length; i++) { // If this message is null, remove it, drop back the i count, and jump back to the begining // of the loop. if (!messages[i]) { messages.RemoveAt(i); i--; continue; }

     //  If this message object does exist, then move it along the y axis by lineSize.
     //  The y axis uses normalized coordinates, so we divide by the screen height to convert
     //  pixel coordinates into normalized screen coordinates.

     (messages[i] as GUIText).transform.position.y += directionFactor * (lineSize/Screen.height);
 }

 //  All the existing messages have been moved, making room for the new one.
 //  Instantiate a new message from the prefab, set it's text value, and add it to the
 //  array of messages.
 var newMessage : GUIText = Instantiate(messagePrefab, Vector3(startPos.x/Screen.width, startPos.y/Screen.height, startPos.z), transform.rotation);
 newMessage.text = messageText;
 newMessage.gameObject.layer = layerTag;
 messages.Add(newMessage);

}

And finally, this is my script that controls the scene:

//this is where dialogs are defined and the timing to display them are defined. //used in combination with MessageList.js http://www.unifycommunity.com/wiki/index.php?title=MessageList

var CameraInUse : GameObject; //define the camera being used in the scene var SceneSpeed : float = 1; //this adjusts the speed at which the dialogs and cutscene is played. Note: the GUITextMessageList prefab controls the fade out and live time speed of the text on screen. (multiply the live time and fade time by the same SceneSpeed number)

function Start () {

 DisplayMessages();


}

function DisplayMessages(){

 //find the sound effect manager to play sounds
 var PlaySoundHere : SoundEffectManager = GameObject.FindWithTag("SoundEffects").GetComponent(SoundEffectManager);


 iTween.moveBy(CameraInUse,{"x":2.5, "y":1.25, "z":0, "time":SceneSpeed*25, "delay":SceneSpeed*0, "transition": "linear"}); 

 yield WaitForSeconds(SceneSpeed*1);
 MessageList.Instance().AddMessage("One quiet evening in London,");
 yield WaitForSeconds(SceneSpeed*3);
 MessageList.Instance().AddMessage("Most people have just finished their day."); 
 yield WaitForSeconds(SceneSpeed*3);
 MessageList.Instance().AddMessage("Some are on their way to the pub.");
 yield WaitForSeconds(SceneSpeed*3);
 MessageList.Instance().AddMessage("Some are about to have dinner with their sons and daughters.");
 yield WaitForSeconds(SceneSpeed*3);
 MessageList.Instance().AddMessage("And some are brushing their teeth, getting ready for an early night...");
 yield WaitForSeconds(SceneSpeed*6);
 MessageList.Instance().AddMessage("When all of a sudden...");
 yield WaitForSeconds(SceneSpeed*1);
 PlaySoundHere.PlayEarthquake(); // start playing earthquake sound loop
 iTween.shake(CameraInUse,{"x":.5, "y":.1, "z":.5, "time":SceneSpeed*5, "delay":SceneSpeed*0}); 
 yield WaitForSeconds(SceneSpeed*5); 
 PlaySoundHere.StopEarthquake(); // stop playing earthquake sound loop
 iTween.moveBy(CameraInUse,{"x":-10, "y":2.5, "z":0, "time":SceneSpeed*25, "delay":SceneSpeed*0, "transition": "linear"}); 
 iTween.rotateBy(CameraInUse,{"x":.015, "y":.02, "z":0, "time":SceneSpeed*25, "delay":SceneSpeed*0, "transition": "linear"}); 
 MessageList.Instance().AddMessage("'An earthquake???!!'");
 yield WaitForSeconds(SceneSpeed*3);
 MessageList.Instance().AddMessage("'But we never have earthquakes in London!'");
 yield WaitForSeconds(SceneSpeed*3);
 MessageList.Instance().AddMessage("'What is it???'");
 yield WaitForSeconds(SceneSpeed*6);
 MessageList.Instance().AddMessage("Nobody knows the answer, but everyone soon forgets about it.");
 yield WaitForSeconds(SceneSpeed*3);
 MessageList.Instance().AddMessage("... well ...");
 yield WaitForSeconds(SceneSpeed*3);
 MessageList.Instance().AddMessage("ALMOST everyone ......");
 yield WaitForSeconds(SceneSpeed*3);
 MessageList.Instance().AddMessage("");
 yield WaitForSeconds(SceneSpeed*3);

     //disable click indicator from being created
 var loadingMessageObject = GameObject.Find("Loading_Message");
 var loadingMessageScript : loading_message = loadingMessageObject.GetComponent(loading_message);
 loadingMessageScript.LoadNextLevel();       



 // Load the scene named "cutscene_1_1".
 Application.LoadLevel ("cutscene_1_1");

}

I've tried .net2.0, .net2.0 subset, but it didn't make a difference. Any ideas?

Thanks!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Mantas-Puida · Mar 28, 2011 at 09:59 AM

This stack trace tells me that your problem lies inside of "AddMessage" function and "ToBool" tells me that something wrong goes when trying to convert something to bool.

at Boo.Lang.Runtime.RuntimeServices.ToBool (System.Object value) [0x00000] in <filename unknown>:0 
at MessageList.AddMessage (System.String messageText) [0x00000] in <filename unknown>:0

I guess following code causes all the trouble, because it tries to convert message instance to bool:

if (!messages[i])

Try to rewrite it like this:

if (messages[i] != null)

P.S. Unity 3.3 handles such cases much better than Unity 3.0.

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 theBrandonWu · Mar 29, 2011 at 10:23 AM 0
Share

Thanks for the reply. I posted this a while ago and found out the problem was with variable typing with the messages array. Thanks!

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 can I Javascript a phone call from within Unity? 1 Answer

Unity iOS: mixing windows AND mac development 2 Answers

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

Building from Unity into XCode to deploy onto the iPhone 1 Answer

Do blob shadow projectors work on iPhone? 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