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 InfiniBuzz · Jul 02, 2013 at 12:26 AM · iosserializationsavegameunityserializer

Serialization issue with multiple SaveGames iOS - Unity Serializer [SOLVED]

Hi

I am trying to save some of my GameObjects with whydoidoit's unity serializer. I have some kind of checkpoints (triggers) and when the character hits them the game is saved. Currently only a cube and a sphere with colliders and rigidbodies are saved.

In the editor everything is working, but the game crashes on iOS.

in xcode I get this output:

 System.String doesn't implement interface System.IEnumerator
 * Assertion: should not be reached at mini-trampolines.c:183

When I pass the first trigger everything gets saved properly and I can also load the game again. But when I hit the second trigger (without loading/quit) the game crashes with the above output. When I quit the game after passing the first "checkpoint" and load the level again (at this checkpoint) I can pass the second checkpoint but the game crashes later at the third checkpoint and so on.

I first thought it is because I tried to save objects with custom scripts using interfaces but I had the same issue after removing them.

The crash happens on this line:

 LevelSerializer.SaveGame(name);

I also increased the trampolines in the AOT compilation options.

Does someone know this issue? I didn't find much about it and I'm currently not saving complex objects or anything. Appreciate any help


I solved this by making specific serialization code aot-safe

Comment
Add comment · Show 3
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 InfiniBuzz · Jul 03, 2013 at 11:20 AM 0
Share

anyone, @whydoidoit?:)

avatar image SomeGuy22 · Jul 09, 2013 at 07:09 PM 0
Share

Are you using IEnumerable containers?

avatar image InfiniBuzz · Jul 09, 2013 at 07:43 PM 0
Share

Yes but currently im not saving them and unity serializer uses them internal as far as I know. It should be possible to save them anyway.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by SomeGuy22 · Jul 09, 2013 at 07:17 PM

Actually this appears to be a bug on the iOS side of things--FeatureCreep from Unity Forums has found out exactly why:

"This problem only occurs on iOS because it is due to a limitation in the Ahead-Of-Time (AOT) compiler that is used to compile Mono byte code into native code. Thus, your app probably runs fine in the Editor, WebPlayer, Windows, Mac, etc. But, on iOS, it will crash, sometimes the crashes will appear to be random. The reason this crash is occurring is because the IEnumerable.GetEnumerator() is being used instead of the non-generic IEnumerable.GetEnumerator() to get an enumerator object used by foreach iteration blocks. Since IEnumerable is a type of interface dispatch not supported by full AOT (see http://www.mono-project.com/AOT), the 'enumerator' returned by this method is actually a string object (I don't know why), which results in a crash."

He also has a temporary solution here until the mods can get a fix to this: http://forum.unity3d.com/threads/168019-quot-System-String-doesn-t-implement-interface-System-Collections-IEnumerator-quot-crash?p=1149128

You need to replace your IEnumerables with a AOT-safe methods (he wrote one on the forum).

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 InfiniBuzz · Jul 09, 2013 at 07:52 PM 0
Share

Yes I found this too and tried it but since it didnt solve the problem I reduced the saved objects to some primitive gameObjects without scripts, but no success. Also if I out-comment the save codeline it stops crashing what makes me think of a bug in the unityserializer. But thank you vm for your research

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

17 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Json . NET, iOS and AOT 1 Answer

getting "ExecutionEngineException" while serializing a list into a file. Can anybody help me please?? 1 Answer

How do i change my save "Total Coin" everytime i get more coins. 0 Answers

Serialize on iOS , that is AOT safe. 2 Answers

Save Game loading Deserialization from disk 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