Search Unity

Namespace 'ShowResult' not found on TeamCity.

Discussion in 'Unity Ads & User Acquisition' started by LuisRB-TheBreachStudios, Jan 17, 2019.

  1. LuisRB-TheBreachStudios

    LuisRB-TheBreachStudios

    Joined:
    Sep 26, 2018
    Posts:
    3
    When I try to build a game command via TeamCity I get the next error.

    error CS0246: The type or namespace name `ShowResult' could not be found. Are you missing an assembly reference?

    Somehow this compiles ok when I build the game manually.

    I tried to run it outside my Integration Server and I got the faced the same issue, if I open the project manually the issue is not there anymore. The problem is that I can't open the project on my Integration Server pipeline.

    I researched every corner to solve and tried everything but I got no luck.

    Do someone face this problem or a similar one? How did you proceed to solve it?
    I need to perform some black magic when I execute my build method?

    Unity Version: 2017.4.18f1
    OS: macOS High Sierra 10.13.6

    Thank you in advance.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. LuisRB-TheBreachStudios

    LuisRB-TheBreachStudios

    Joined:
    Sep 26, 2018
    Posts:
    3
    I already read that article. The main issue is that I can't reload the services via command line since is a UI feature. There's any way to reimport and recompile via code?
     
  4. LuisRB-TheBreachStudios

    LuisRB-TheBreachStudios

    Joined:
    Sep 26, 2018
    Posts:
    3
    I have some progress here.
    I think the main issue is Unity changing platforms and refreshing service code.
    When I create a command line on my Integration machine Library folder is not present since we want a clean setup.
    To solve this I just switch platform manually before calling any Unity Build method.
    This can be done calling:

    Code (CSharp):
    1. BuildTarget target = BuildTarget.Android;
    2. EditorUserBuildSettings.SwitchActiveBuildTarget(target);
    Being target variable the platform you actually want to build, I pass this via arguments from my command line.

    Then I reimport all the assets calling:

    Code (CSharp):
    1. AssetDatabase.Refresh();
    Now I can call Unity Builder.

    Code (CSharp):
    1. BuildPipeline.BuildPlayer(options);
    I didn't check those steps alone so maybe we can skip one of them and make this process shorter. Further investigation is needed, but for now this is working.

    Happy coding!

    Edit: Code format, added BuildPlayer code as example.
     
    Last edited: Jan 18, 2019
    ap-unity likes this.