playMaker

Author Topic: Fixing IL2CPP linking errors[SOLVED]  (Read 29396 times)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3201
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Fixing IL2CPP linking errors[SOLVED]
« on: February 02, 2015, 03:01:11 PM »
Apparently IL2CPP for iOS does not support Unity Networking yet. To build a project with Playmaker:

  • Import Assets/PlayMaker/Versions/PlayMakerNACL.unitypackage. These dlls have networking stripped out.
  • Delete the PlayMaker/Actions/Network folder.
  • Edit PlayMaker/Actions/CreateObject.cs and add UNITY_IPHONE To the #if list of platforms that don't support networking.

If you use networking in your project you will have to wait for Unity to support it in IL2CPP for iOS!
« Last Edit: March 09, 2017, 07:02:13 AM by jeanfabre »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3201
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Fixing IL2CPP linking errors
« Reply #1 on: February 03, 2015, 10:59:32 AM »
Also please check these threads on the Unity forum if you're having problems with IL2CPP and iOS:

http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551/
http://forum.unity3d.com/threads/official-the-collected-il2cpp-forum-topic.247039/
« Last Edit: February 03, 2015, 11:02:43 AM by Alex Chouls »

XilenceX

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #2 on: February 04, 2015, 04:01:54 PM »
I followed all the instructions to the letter and this got rid of the linker errors!
Sadly my GUI that's based on the new Unity canvas system is also gone now. ;(
And XCode throws errors at me while the game runs that lots of scripts are missing. Does this have anything to do with this "fix"? The GUI worked fine before I switched to IL2CPP.

The errors all look like this:
"A script behaviour has a different serialization layout when loading. (Read 24 bytes but expected 84 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
 
(Filename:  Line: 1170)

The referenced script on this Behaviour is missing!
 
(Filename:  Line: 1608)

A script behaviour has a different serialization layout when loading. (Read 24 bytes but expected 104 bytes)
Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
 
(Filename:  Line: 1170)

"

EDIT: this is probably not a problem with Playmaker since others are getting the same errors when using the new GUI system.
« Last Edit: February 04, 2015, 08:54:55 PM by XilenceX »

LAB618

  • Playmaker Newbie
  • *
  • Posts: 23
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #3 on: February 05, 2015, 03:05:33 PM »
Hi Alex,

I followed your instructions, and Xcode now builds my project without the original errors, but when it starts running on the device it shows up the following errors and can't load the next scene:

ArgumentException: Set Method not found for 'active'
  at System.IO.MonoIO.GetFileType (IntPtr handle, MonoIOError& error) [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.StrongNameKeyPair.System.Runtime.Serialization.ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo info, StreamingContext context) [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 PlayMakerTriggerStay..ctor () [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 SA_ScreenShotMaker+<SaveScreenshot>c__Iterator5.Reset () [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.UpdateState (HutongGames.PlayMaker.FsmState state) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Update () [0x00000] in <filename unknown>:0
  at PlayMakerFSM.Update () [0x00000] in <filename unknown>:0
  at Replacements.Attribute.CheckParameters (System.Object element, System.Type attributeType) [0x00000] in <filename unknown>:0
Replacements.Attribute:CheckParameters(Object, Type)
 
(Filename: currently not available on il2cpp Line: -1)

Any idea what's wrong, and how to fix it?

Cheers
Steve

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3201
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Fixing IL2CPP linking errors
« Reply #4 on: February 05, 2015, 03:29:08 PM »
@LAB618 From the error, it looks like you're trying to use the SetProperty action to set a GameObject's active property which is depreciated since Unity 3.5. You should use the Activate Game Object action instead. If you right click Set Property in the Action Browser you can find where it's used...

@XilenceX This doesn't sound like anything that would be effected by the networking fix. IL2CPP support is still very new and Unity is still working out some kinks...

LAB618

  • Playmaker Newbie
  • *
  • Posts: 23
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #5 on: February 05, 2015, 03:33:15 PM »
Thanks Alex,

I'm new to Unity and Playmaker, so didn't realise the active property had been deprecated. I use it quite a bit, so will now go through my project and change it.

Cheers
Steve

meaphly

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #6 on: April 23, 2015, 05:42:00 PM »
From the Output Xcode is giving me, I witness an unmitigated disaster. Is this gonna get fixed by any side?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #7 on: April 23, 2015, 09:47:59 PM »
Hi,

 I can publish to IOS with IL2cpp. What is the error you get in xCode?

It's likely that third party assets needs updating or are not yet compatible, but I can publish a project using PlayMaker. Make sure for example that you have stripping disabled ( and run the latest PlayMaker and Unity versions)

 Bye,

 Jean

meaphly

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #8 on: April 24, 2015, 04:52:17 AM »
I can publish too but apart a menu scene the rest do not work properly. The magnitude of this is big in the project. Stripping is disabled. If you have anything that I could have ignored when using IL2CPP please tell me.
For the record I use "Set Property" a lot since that is why I mainly use Playmaker. Tell me if I have to do everything using scripting or another plugin.
I handle from Camera Shaders' float values to Wheel Colliders on the fly and UI position elements. As far as it concerns activation of objects I use "Activate" action only, "Enable" property (set property: enabled, boolean) on components (objects) of game objects.

I get a lot of

(Filename: currently not available on il2cpp Line: -1)

and a lot of

(HutongGames.PlayMaker.FsmState state) [0x00000] in <filename unknown>:0
  at HutongGames.PlayMaker.Fsm.Update () [0x00000] in <filename unknown>:0
  at PlayMakerFSM.Update () [0x00000] in <filename unknown>:0
 at Replacements.RemotingServices.CreateClientProxy (System.Type objectType, System.String url, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0
Replacements.RemotingServices:CreateClientProxy(Type, String, Object[])
« Last Edit: April 24, 2015, 06:09:56 AM by meaphly »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #9 on: April 24, 2015, 05:19:22 AM »
Hi,

 This is still *likely* something happening within Unity, not PlayMaker, because the root of the cause is still the RPC method from Unity that doesn't compile properly.

http://forum.unity3d.com/threads/bug-replacements-remotingservices-createclientproxy-in-unity-5-0-1-and-xcode-6.317067/

Let me clarify, you say that you have one scene that you can publish but not others, in the SAME projects?

 Bye,

 Jean

meaphly

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #10 on: April 24, 2015, 05:39:55 AM »
I get the build done. It is running, all of it. But the behavior is erroneous. Trigger Events happening on their own (this happened after I updated to the latest Playmaker today, I had the first version that came to support Unity 5 didn't happen before), and more things. The main menu only seems to be working properly, meaning as expected even though the output is going crazy. If you check above I edited my previous reply with some info.
« Last Edit: April 24, 2015, 05:42:41 AM by meaphly »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #11 on: April 24, 2015, 06:22:50 AM »
Hi,

 ok, this will need to be taken down piece by piece. Can you check that PlayMaker itself has no errors in the PlayMaker editor ( different from Unity own console and errors). Check this when playing in editor.

 then make a web build or  desktop build, if it behaves ok or not.

-- what kind of custom actions are you using? this is important, for examepl you mention trigger events. How do you work with trigger events, is it by listening for global system events, or using actions?


Bye,

 Jean

meaphly

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #12 on: April 24, 2015, 07:14:21 AM »
Ok so I built for armv7 using Mono works wonders, Android works wonders. Using IL2CPP I get what I already mentioned. My custom actions are some Game Data Editor that work fine no matter where I try. The trigger event I mentioned is a simple On Trigger Enter (Trigger Collider) event. I also have "EVERYPLAY_IPHONE;GDE_PLAYMAKER_SUPPORT" scripting define symbols. On Editor or any other platform I tried I get no errors or erroneous behavior. I wanted to pinpoint the cause but there is no "one cause". The things don't fit I am afraid. It is wide spectrum. I will drink some coffee forget about it for some time and then get back to it :)
Watching 2 months of non-stop work not behaving on a platform is never encouraging.
Even the Set Property for unity engine sprite renderer set sprite doesn't work.
« Last Edit: April 24, 2015, 08:22:17 AM by meaphly »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #13 on: April 26, 2015, 11:55:09 PM »
Hi,

 You should not use SetProperty when targeting iPhone, some work some doesn't, I never could make sense of the rule for this. I removed all SetProperties and built custom actions for each one of them, and all problems where gone from that front, that was before IL2CPP, but I we stick to this.

 Bye,

 Jean

meaphly

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Fixing IL2CPP linking errors
« Reply #14 on: May 01, 2015, 01:12:54 AM »
I made a custom action that simply calls some functions I want... I don't use the action... and here I got mindfucked: Any Set Property action I have that calls the same function miraculously works and the output leaves it out... dafuq? for me it is a win win. I think you should try this. I am so thankful for those caffeine and cigarette allnighters... so it is like adding words in a database. Strange (for me that is).