Search Unity

Problem with link.xml

Discussion in 'Unity Build Automation' started by chatpongs, Jun 30, 2015.

  1. chatpongs

    chatpongs

    Joined:
    Mar 2, 2015
    Posts:
    24
    Hi,

    I am wondering if Cloud Build support linker file (link.xml in the Asset’s root)

    After updating to 5.1.1, building with IL2CPP seems to rip off an assembly in Parse plugin. So, I will get an error

    missingMethodException: Method not found: 'Default constructor not found...ctor() of Parse.PlatformHooks'.

    The solution for local build is to create the linker file with this code in link.xml

    <linker>
    <assembly fullname="UnityEngine">
    <type fullname="UnityEngine.iOS.NotificationServices" preserve="all"/>
    <type fullname="UnityEngine.NotificationServices" preserve="all"/>
    <type fullname="UnityEngine.iOS.RemoteNotification" preserve="all"/>
    <type fullname="UnityEngine.RemoteNotification" preserve="all"/>
    <type fullname="UnityEngine.AndroidJavaClass" preserve="all"/>
    <type fullname="UnityEngine.AndroidJavaObject" preserve="all"/>
    </assembly>

    <assembly fullname="Parse.Unity">
    <namespace fullname="Parse" preserve="all"/>
    <namespace fullname="Parse.Internal" preserve="all"/>
    </assembly>
    </linker>

    Which works fine. But building with Unity Cloud Build, I get a null reference error which is not related to Parse, but the constructor of a simple class that works fine with local build

    With many trials and errors, I think I can assume that Unity Cloud Build doesn’t support the linker file. So I would like to know if this is a known issue for Cloud Build or not.

    Thank you,
     
  2. David-Berger

    David-Berger

    Unity Technologies

    Joined:
    Jul 16, 2014
    Posts:
    745
    Welcome to the Forums!

    That's interesting, can you please check the log for errors and if it uses the correct Unity Version?
     
  3. chatpongs

    chatpongs

    Joined:
    Mar 2, 2015
    Posts:
    24
    Unity version in Cloud Build is set to Latest (The log says it is 5.1.1f1) There are many warnings in the log since the game is made one year ago, most of them are about NGUI and some obsolete stuff. No errors.

    So putting link.xml in Asset's root is correct? I thought the file has to be injected another way for Cloud Build
     
  4. David-Berger

    David-Berger

    Unity Technologies

    Joined:
    Jul 16, 2014
    Posts:
    745
    Yes, that's correct.

    It should be picked up by UnusedByteCodeStripper2 which runs before the il2cpp.exe. You should see the invocation of the stripper in the logfile of the editor/cloud build. This should help you to verify if it gets passed the xml file in there. Could you please have a look into your local build editor log if you can spot it and then compare it with the full log of your Cloud Build build?
     
  5. chatpongs

    chatpongs

    Joined:
    Mar 2, 2015
    Posts:
    24
    After almost a hundred of builds, finally I found what caused the problem. It is not about link.xml but the UnityScript (JS) files. My project is 99% C#, there are only some JS files which are from the plugins. After I converted them to C#, the problem went away

    I don't know why but I hope this could help people having the same problem as mine :)
     
    David-Berger likes this.