playMaker

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

serkanos

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Fixing IL2CPP linking errors
« Reply #30 on: June 25, 2015, 10:04:16 AM »
doesnt work. My settings:

symlink unity libraries =on
IL2cpp
universal
net 2.0
ios version 7.0
stripping disabled
script call opt  Fast no exceptions
static and dynamic batching on
optimize mesh data off

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Fixing IL2CPP linking errors
« Reply #31 on: June 25, 2015, 11:09:13 AM »
Hi,

 try slow and safe option and let me know.

if that doesn't work, then we'll have to look at each access individually and I'll run tests locally myself and move on this way.


 Bye,

 Jean

serkanos

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Fixing IL2CPP linking errors
« Reply #32 on: June 25, 2015, 04:37:49 PM »
No doest work :(

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Fixing IL2CPP linking errors
« Reply #33 on: June 26, 2015, 05:41:48 AM »
Hi,

 ok, so let's start one step at a time.

1: Take for example one of the set or get property you us in your scene and extract JUST that.

2: Make a new scene which does JUST that, for example if it's a light intensity control, create just one light, one fsm with one state with one set property to control that light intensity ( not everyframe, just once).

3: Publish that scene only

If that doesn't work, then you'll need to use a custom in place of ALL the places you contorl light intensity using "Get/set Property".

There is unfortunatly no other way I know off, especialy if it doesn't work even with no stripping (which is odd, because it really means everything it there), so TRIPLE check that the error is really related to the usage of "Get/Set property" before refactoring, it could be simply because the light is not referenced properly and so it's null and throw an error.


Bye,

 Jean

serkanos

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Fixing IL2CPP linking errors
« Reply #34 on: June 26, 2015, 01:07:21 PM »
Hi. I sended my project package. İf you can test I would be pleased. İts a car. When press ugui buttons doesnt work on ios device. File is 2 mb I couldnt upload your forum sorry.

http://www.filedropper.com/sendhutong



« Last Edit: June 28, 2015, 09:29:56 AM by serkanos »

serkanos

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Fixing IL2CPP linking errors
« Reply #35 on: June 28, 2015, 06:31:08 PM »
I created new project and add  only get and set property fsm to gui text. I changed text with get and set property. İt does work on  unity editor but I build for ios İt doesnt work.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Fixing IL2CPP linking errors
« Reply #36 on: June 29, 2015, 01:54:06 AM »
Hi,

 What do you mean by GUI Text? is it a component "GUIText". if that's the case, I can make it work when no stripping option is selected, else if I select the maximum stripping option, I have to included the GUIText into the link.xml

can you try the following instructions. they work for me:

The solution is:

-- Switch to PlayMaker Nacl version, which has its network support removed. Go to the PlayMaker/Versions folder and install PlaymakerNACL.unitypackage
-- Remove all networking actions (in PlayMaker/Actions/networking)


1: you have PlayMaker Nacl installed
2: you have micro mscorlib stripping selected
3: you have an GameObject with a GUITexture component
4: you have an fsm with a "Set Property" action setting a property of that GUITexture

5: create a link.xml under your "Assets/" folder with the following content:
<linker>
    <assembly fullname="UnityEngine">
        <type fullname="UnityEngine.GUITexture" preserve="all"/>
    </assembly>
</linker>


6: publish in an IOS device, and it will work, the GUITexture component will be preserved from stripping ( Unity likely bin that because it's obsolete, fair enough, but it's a good simple case), and accessing the GUITtexture using reflection ( "Set/get property" action) will now work fine.

So, in your own projects, you'll have to identify what is missing in terms of properties and fill the link.xml accordingly.

more on this here:

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

If you have trouble with this, let me know. It's important we provide a clear set of instructions on this case, cause a lot of members are confronted with this problem.

What version of Unity are you using? GUITexture is very limited, and I would strongly recommand you use the new Unity UI system, which will give you more possibilities and will work better in the long run. And you have all the custom actions needed to work with this from the wiki or Ecosystem.

 Bye,

 Jean

serkanos

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Fixing IL2CPP linking errors
« Reply #37 on: June 29, 2015, 04:33:37 AM »
I use 4.6.6. I dont use guitext but I wanted to test just to set/get property. Yes it worked with link.xml. But I didnt understand  what is link.xml?  İf its needed how I use it on my project. I am not programmer I am an artist. Thats why  I selected playmaker. Thanks for everything

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Fixing IL2CPP linking errors
« Reply #38 on: June 29, 2015, 06:09:23 AM »
Hi,

Ah, I am glad this works! the way to go is now to locate each component to access and simply add them to this link.xml.

there is a link to the documentation on this ( on my last post), simply read through it, even if you don't catch the "how to", it explains the concept where basically, some classes are not referenced in purposed to reduce the build size, and so the class is "stripped" or in simple terms missing in the final build. The Link.xml allows the developer to create a list of class that MUST not be stripped.

 It's unfortunate, but it's nothing PlayMaker can do about it. It's inherent to how Unity compiles and optimize its code when publishing to mobile.

however, let me work on a small tool, at least I'll mention this to Alex, where we could introspect a project and the usage of Set/Get property to at least give you a list of classes that you are accessing with this actions and so it's likely all them classes you need to add to the link.xml.

Bye,

 Jean


serkanos

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Fixing IL2CPP linking errors
« Reply #39 on: June 29, 2015, 10:34:26 AM »
Yes I read but I didnt understand  ???. I will wait your tool.I hope it will not take too long to prepare. Very thnks.
« Last Edit: June 29, 2015, 10:36:29 AM by serkanos »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Fixing IL2CPP linking errors
« Reply #40 on: June 30, 2015, 03:37:50 PM »
Hi,

 It will take some time... I would definitly make the effort right now to manually go over your set/get properties action send me a list of the components you are accessing. then I'll produce the link.xml for you right away. ok?

Else, early next week I coudl have something helping along, but not really final...

Bye,

 Jean

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Fixing IL2CPP linking errors
« Reply #41 on: June 30, 2015, 06:37:09 PM »
Have been following this thread for a while as I will also need to fix this issue. A tool would be super great!

Will the PlayMaker Nacl allow for Photon networking?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Fixing IL2CPP linking errors
« Reply #42 on: July 01, 2015, 04:09:19 AM »
Hi,

 yes, the Nacl Version only remove the built in old Unity networking support, other networking solution works.

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15594
  • Official Playmaker Support
Re: Fixing IL2CPP linking errors
« Reply #43 on: July 08, 2015, 07:54:51 AM »
Hi,

 ok, I have a first basic introspection system to help you with the creation of the linker.xml.

[edit] it's now available on the Ecosystem with a video


1: Download and install the attached Package ( a beta version of the PlayMaker utils)
2: Locate and select the "Linker Wizard" asset in your project ( at the root of the assets)
3: follow the instruction ( install the actions, which will replace GetProperty, SetProperty and MethodInvoke with the ones debugging their usage, so it's project wise with no effort)
4: make sure you checked debug to true on the linker wizard
5: run your game in Unity and check the console for all the logs
6: create the link.xml

You'll end up with a link.xml file in your assets ( you can ping and select it from the wizard)


so let me know how it goes.

Bye,

 Jean
« Last Edit: September 10, 2015, 12:26:48 PM by jeanfabre »

serkanos

  • Playmaker Newbie
  • *
  • Posts: 38
Re: Fixing IL2CPP linking errors
« Reply #44 on: July 09, 2015, 06:42:04 AM »
Very thanks. İf it creates automatically to linker.xml for me  it will be very usefull  :D