Search Unity

Export Method Not Found Signature Error

Discussion in 'Unity Build Automation' started by cryptoforge, Sep 16, 2018.

  1. cryptoforge

    cryptoforge

    Joined:
    Jan 21, 2015
    Posts:
    60
    I can not make cloud builds after Unity Cloud interface has been updated.
    My setup worked fine before it. This is very frustrating considering 1 build attempt takes an hour for me.

    Here is the output for the error.


    Here is my script.


    And my script...

    Code (CSharp):
    1. #if UNITY_CLOUD_BUILD
    2. using UnityEngine;
    3. using UnityEditor;
    4.    
    5. using PlayEntertainment.Enums;
    6. using PlayEntertainment.XML;
    7.  
    8. public class CloudBuildHelper
    9. {
    10.     public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
    11.     {
    12.         //string GUID = AssetDatabase.AssetPathToGUID("Assets/Photon Unity Networking/Resources/PhotonServerSettings-test.asset");
    13.  
    14.         //// UPDATE PHOTON
    15.         //if (GUID == "") {
    16.         //    AssetDatabase.RenameAsset("Assets/Photon Unity Networking/Resources/PhotonServerSettings.asset", "PhotonServerSettings-test.asset");
    17.         //    AssetDatabase.RenameAsset("Assets/Photon Unity Networking/Resources/PhotonServerSettings-prod.asset", "PhotonServerSettings.asset");
    18.  
    19.         //    Debug.LogWarning("Switched to PROD");
    20.         //} else {
    21.         //    //AssetDatabase.RenameAsset("Assets/Photon Unity Networking/Resources/PhotonServerSettings.asset", "PhotonServerSettings-prod.asset");
    22.         //    //AssetDatabase.RenameAsset("Assets/Photon Unity Networking/Resources/PhotonServerSettings-test.asset", "PhotonServerSettings.asset");
    23.  
    24.         //    //Debug.LogWarning("Switched to DEV");
    25.         //}
    26.  
    27.         //AssetDatabase.Refresh();
    28.  
    29.         //AssetDatabase.DeleteAsset("Assets/Photon Unity Networking/Resources/PhotonServerSettings-cloud.asset", "PhotonServerSettings.asset");
    30.         //AssetDatabase.RenameAsset("Assets/Photon Unity Networking/Resources/PhotonServerSettings-cloud.asset", "PhotonServerSettings.asset");
    31.  
    32.         var cloudBuildTargetName = "unknown";
    33.         manifest.TryGetValue("cloudBuildTargetName", out cloudBuildTargetName);
    34.  
    35.         var buildNumber = "unknown";
    36.         manifest.TryGetValue("buildNumber", out buildNumber);
    37.  
    38.         var scmCommitId = "unknown";
    39.         manifest.TryGetValue("scmCommitId", out scmCommitId);
    40.  
    41.         Debug.LogWarning("PREBUILD Script: cloudBuildTargetName => " + cloudBuildTargetName);
    42.         Debug.LogWarning("PREBUILD Script: buildNumber => " + buildNumber);
    43.         Debug.LogWarning("PREBUILD Script: scmCommitId => " + scmCommitId);
    44.  
    45.         PlayerSettings.bundleVersion = string.Format("1.0.{0}", buildNumber);
    46.  
    47.         //
    48.         Debug.LogWarning("START: Update => AppSettingContainer");
    49.         AppSettingContainer appSettingContainer = new AppSettingContainer();
    50.  
    51.         appSettingContainer = AppSettingContainer.LoadFromTextAsset("XML/app_data");
    52.  
    53.         appSettingContainer.AppSettings[0].CloudBuild_TargetName = cloudBuildTargetName;
    54.         appSettingContainer.AppSettings[0].CloudBuild_BuildNumber = buildNumber;
    55.         appSettingContainer.AppSettings[0].CloudBuild_CommitId = scmCommitId;
    56.  
    57.         if (cloudBuildTargetName.Equals("masters-of-conquest-headless")) {
    58.             appSettingContainer.AppSettings[0].BuildTypeIndex = (int)BuildType.Master;
    59.         }
    60.  
    61.         if (cloudBuildTargetName.Equals("masters-of-conquest-win64")) {
    62.             appSettingContainer.AppSettings[0].BuildTypeIndex = (int)BuildType.Guest;
    63.         }
    64.  
    65.         if (cloudBuildTargetName.Equals("masters-of-conquest-osx")) {
    66.             appSettingContainer.AppSettings[0].BuildTypeIndex = (int)BuildType.Guest;
    67.         }
    68.  
    69.         appSettingContainer.AppSettings[0].PhotonAppId = "fa5e21e8-531b-49fe-93ac-4915068825ea";
    70.  
    71.         appSettingContainer.SaveToTextAsset("XML/app_data");
    72.         Debug.LogWarning("END: Update => AppSettingContainer");
    73.         //
    74.     }
    75.     public static void Test()
    76.     {
    77.            
    78.     }
    79. }
    80. #endif
    My PreExport setup.



    Please help. This is super frustrating!
     
  2. thibouf

    thibouf

    Joined:
    Mar 17, 2017
    Posts:
    105
    I already had this problem before , here are some things I would try:
    - Try clean build (has the problem twice, clean build just magically fix it ..)
    - Check that you don't have any other errors before in your log. I have noticed that if something else not compiling may lead to this file not being compiled.
    - Try removing #if UNITY_CLOUD_BUILD to be sure it is well compiled (I saw that you added the define in your custom defines, but I suspect sometimes Unity has trouble compiling files starting with that king of preprocessor directive...
    Here is a little code snippet I have added at the end of my own CloudBuildHelper that ensure it will compile in the editor (so I can check my code in the editor without waiting for the end the build :

    Code (CSharp):
    1.  
    2.  
    3. #if !UNITY_CLOUD_BUILD
    4. namespace UnityEngine
    5. {
    6.     namespace CloudBuild
    7.     {
    8.  
    9.         public class BuildManifestObject
    10.         {
    11.             public bool TryGetValue<T>(string key, out T result)
    12.             {
    13.                 result = default(T);
    14.                 return true;
    15.             }
    16.         }
    17.     }
    18. }
    19. #endif
     
    jenniferplanellas and Zelek like this.
  3. josh_dreemar

    josh_dreemar

    Joined:
    Jan 9, 2019
    Posts:
    8
    I've been having issues after changing from 2018.2.11 -> 2018.3.0 (others seems to be having issues somewhere around 2018.2.16).
    I can compile on the cloud perfectly if I remove the #if UNITY_CLOUD_BUILD, however this obviously prevents the ability to enter play mode in the local editor.
     
  4. josh_dreemar

    josh_dreemar

    Joined:
    Jan 9, 2019
    Posts:
    8
    It seems other defines still work in cloud build.
    I noticed the cloud build machines are running MacOS and luckily I work on Windows.

    This was my old code here:

    Code (CSharp):
    1. //Only compile when on Cloud Build Machine
    2. #if UNITY_CLOUD_BUILD
    3.     public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
    4.     {
    5.         //Pre-export code here
    6.     }
    7. #endif
    I replaced the cloud-build only #if with a not windows #if:

    Code (CSharp):
    1. //Only compile when not on Windows Editor
    2. #if !UNITY_EDITOR_WIN
    3.     public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
    4.     {
    5.         //Pre-export code here
    6.     }
    7. #endif
    and my app built just fine.