Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: jongkook on January 02, 2017, 04:55:47 AM

Title: iOS crash during game play. il2cpp related
Post by: jongkook on January 02, 2017, 04:55:47 AM
iOS crash during game play. il2cpp related
Crash occurs when loading a scene or during a game.

xcode crash report
(https://dl.dropboxusercontent.com/u/167516849/xcode_error.jpg)

Unloading 20 unused Assets to reduce memory usage. Loaded Objects now: 2902.
Total: 8.629416 ms (FindLiveObjects: 0.123875 ms CreateObjectMapping: 0.121625 ms MarkObjects: 7.729250 ms  DeleteObjects: 0.654083 ms)

ArgumentException: Set Method not found for 'material'
  at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.ReflectionUtils.SetMemberValue (System.Reflection.MemberInfo member, System.Object target, System.Object value) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Actions.SetProperty.OnEnter () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmState.OnEnter () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.UpdateStateChanges () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Start () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.ProcessEvent (HutongGames.PlayMaker.FsmEvent fsmEvent, HutongGames.PlayMaker.FsmEventData eventData) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.BroadcastEvent (HutongGames.PlayMaker.FsmEvent fsmEvent, Boolean excludeSelf) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Actions.SendEvent.OnEnter () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmState.OnEnter () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.UpdateStateChanges () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Start () [0x00000] in <filename unknown>:0
UnityEngine.UnhandledExceptionHandler:PrintException(String, Exception)
UnityEngine.UnhandledExceptionHandler:HandleUnhandledException(Object, UnhandledExceptionEventArgs)
 
(Filename: currently not available on il2cpp Line: -1)

LittleNinjas was compiled with optimization - stepping may behave oddly; variables may not be available.
Title: Re: iOS crash during game play. il2cpp related
Post by: jongkook on January 10, 2017, 06:56:42 AM
---Unity's answer ---

Thanks again for submitting this bug report. It looks like this is a code stripping issue related to PlayMaker. I see the following exception in the Xcode console when I run this project:

ArgumentException: Set Method not found for 'material'
  at CK_Record.GetRecordByInternalId (Int32 id) [0x00000] in <filename unknown>:0
  at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.PropertyInfo.GetOptionalCustomModifiers () [0x00000] in <filename unknown>:0
  at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) [0x00000] in <filename unknown>:0
  at PropertyReference.Convert (System.Object& value) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.ReflectionUtils.SetMemberValue (System.Reflection.MemberInfo member, System.Object target, System.Object value) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.ReflectionUtils.SetMemberValue (System.Reflection.MemberInfo[] memberInfo, System.Object target, System.Object value) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmProperty.SetValue () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Actions.SetProperty.OnEnter () [0x00000] in <filename unknown>:0
  at BaseIOSFeaturePreview.UpdateToStartPos () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.FsmState.OnEnter () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.UpdateStateChanges () [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Start () [0x00000] in <filename unknown>:0
  at PlayMakerFSM.Start () [0x00000] in <filename unknown>:0

This error indicates that the type "material" should have a method named "Set", but that method does not exist. You can probably correct this by creating a link.xml file in the project to require the code stripper to preserve the the proper methods. You can find more details about the link.xml file in the Unity manual here:

https://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html

Although it is not part of Unity, I believe that you can use a PlayMaker plugin to generate the proper link.xml file for you. See this thread on the PlayMaker forums:

http://hutonggames.com/playmakerforum/index.php?topic=11126.0
------
 
But the problem is not solved.
Title: Re: iOS crash during game play. il2cpp related
Post by: jeanfabre on January 11, 2017, 04:28:06 AM
Hi,

 Excellent, It's great to see that Unity support is aware of the Linker wizard trick :)

So, what exactly are you setting on the material? are you calling a method or setting a property, and what is this method or property?

 Bye,

 Jean
Title: Re: iOS crash during game play. il2cpp related
Post by: jongkook on January 11, 2017, 04:54:18 AM
I do not know what the problem is.
I created the linker file, but the problem is not resolved.

<linker>
  <assembly fullname="UnityEngine">
    <type fullname="UnityEngine.Camera" preserve="all" />
    <type fullname="UnityEngine.TextMesh" preserve="all" />
    <type fullname="UnityEngine.SphereCollider" preserve="all" />
    <type fullname="UnityEngine.BoxCollider" preserve="all" />
    <type fullname="UnityEngine.ParticleSystem" preserve="all" />
    <type fullname="UnityEngine.CapsuleCollider" preserve="all" />
    <type fullname="UnityEngine.Material" preserve="all" />
  </assembly>
  <assembly fullname="PlayMaker">
    <type fullname="PlayMakerFSM" preserve="all" />
  </assembly>
  <assembly fullname="Assembly-CSharp">
    <type fullname="UILabel" preserve="all" />
    <type fullname="tk2dSprite" preserve="all" />
  </assembly>
Title: Re: iOS crash during game play. il2cpp related
Post by: jeanfabre on January 11, 2017, 05:45:39 AM
Hi,

 you'll need to isolate the state and action that causes this issue and find out what property or method you are calling that doesn't work when published.

Unfortunatly, there are no real other options at this point if the linker.xml doesn't work, we need to know exactly what is called.


 Bye,

 Jean
Title: Re: iOS crash during game play. il2cpp related
Post by: jongkook on January 11, 2017, 02:06:38 PM
---Unity Answer---

Since I'm not too familiar with PlayMaker, I'm not sure what the link.xml file should look like. This seems like a somewhat common problem though, so I would recommend checking with PlayMaker support about it - they may have a solution. 

:'(
Title: Re: iOS crash during game play. il2cpp related
Post by: jeanfabre on January 12, 2017, 01:11:33 AM
Hi,

 Let me try to reformulate.

 One of your "Set Property" or "Call Method" action is faulty, and if the linker wiazrd did not manage to gather the right class for this to work, you need to find in your fsms which action it is and what class, property or method you are trying to set or call.

to do this, you will need to take them down one by one, the best method is to disable a whole feature, if it works then you know its inside this feature, and progress from large features to smaller parts until you find the state and action that gives you this trouble.

 Unfortunatly, no one will be able to help you here as you first need to find out what is not being compiled when publishing.

 Bye,

 Jean
Title: Re: iOS crash during game play. il2cpp related
Post by: jongkook on January 17, 2017, 07:29:36 AM
Fixed a crash bug.
When changing the physic material with the 'set Property' action
Crash bug occurs

It was not a problem when building with 32-bit settings.

crash bug occurs in 64-bit settings.

(https://dl.dropboxusercontent.com/u/167516849/crash_error.jpg)
Title: Re: iOS crash during game play. il2cpp related
Post by: jeanfabre on January 17, 2017, 09:38:55 AM
Hi,

 what property exactly are you trying to reach within this physics material? I'll try to repro and see if I can do something within the linker wizard to fix this.

 Bye,

 Jean
Title: Re: iOS crash during game play. il2cpp related
Post by: jongkook on January 18, 2017, 04:43:07 AM
I used the Linker Wizard to fix the problem, but the problem was not resolved.
So now I do not use the linker wizard.

I used the 'playmaker platforming starter kit' asset.
   (https://www.assetstore.unity3d.com/kr/#!/content/11892)
But I think I used the wrong action.
Title: Re: iOS crash during game play. il2cpp related
Post by: jeanfabre on January 19, 2017, 01:20:49 AM
Hi,

 sorry, I mean: what property of the Physics Material are you trying to access, your screenshot do not expose what property exactly you are accessing. I need this to be able repro and validate a problem or not with this.

 Bye,

 Jean