Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug Unity Gaming Services Analytics build compiler error

Discussion in 'Unity Analytics' started by DirtyFred, Feb 14, 2022.

  1. DirtyFred

    DirtyFred

    Joined:
    May 17, 2014
    Posts:
    29
    Hi,

    I have been trying to use the Game Services Analytics beta, but for some reason i cannot make a build.
    The implementation works, the events are triggered, no errors are found in the console.

    Once i try to build, it stops with the following error: "Error building Player because scripts had compiler errors"
    In the console there are no other errors. If i remove the unity analytics package, the build succeeds.

    The analytics version i use is: "com.unity.services.analytics": "3.0.0-pre.3"
    Unity version 2019.4.30f1c3
    Target platform: Android

    Does anyone know how to fix the issue? What other information shall i provide to fix the issue?

    Thank you
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please post the exact error messages. The compiler errors should be listed with the filename and line number. I was able to create a build using Unity 2020.3.18f1 and Unity 2019.4.1f1 for example, without issue using 3.0.0-pre.3. Did you create a Unity Cloud/ProjectID?
     
  3. DirtyFred

    DirtyFred

    Joined:
    May 17, 2014
    Posts:
    29
    Hi,

    Thank you for your response.

    I have followed this tutorial to set it up: https://docs.unity.com/analytics/LinkingYourProject.html
    I dont have that services dropdown, so i have used the old services tab to link my project. But linking worked, the events are triggered. I have problem only with the build.

    Here are the errors:
    Error building Player because scripts had compiler errors

    Build completed with a result of 'Failed' in 8 seconds (8230 ms)
    UnityEngine.GUIUtility:processEvent (int,intptr)

    UnityEditor.BuildPlayerWindow+BuildMethodException: Error building Player because scripts had compiler errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bf] in <0f738ce44a38415980c84a3da5dab2ff>:0
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <0f738ce44a38415980c84a3da5dab2ff>:0
    UnityEngine.GUIUtility:processEvent (int,intptr)

     
  4. DirtyFred

    DirtyFred

    Joined:
    May 17, 2014
    Posts:
    29
    Issue found and fixed.

    There were no errors indicating this, but i had some json dlls in my project ("Newtonsoft.Json"). Since i wanted to build for android, i had to remove the one which had android selected in the "Selected platforms for plugin"

    Removing that dll, resolved the issue for me.
     
    JeffDUnity3D likes this.
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    One of the first steps in troubleshooting issues like this is to compare to a new/empty project, and compare differences.
     
  6. LivelyUp

    LivelyUp

    Joined:
    May 18, 2017
    Posts:
    2
    I'm getting exactly the same issue as the OP except that I am building for iOS. I tried removing Newtonsoft JSON from the Packages but that did not help.

    What other conflicts might there be with the Analytics package? There is nothing I can find in the editor.log file to help identify the reason for the "compiler errors" and failed build.

    TIA
     
    Last edited: Apr 4, 2022
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please see my previous post.
     
  8. LivelyUp

    LivelyUp

    Joined:
    May 18, 2017
    Posts:
    2
    Yes, I had seen that. Thank you. I was hoping for something a bit more specific after attempting that process for 2 days with no success.

    Similarly, it's frustrating that the error message can't/won't give any clue as to where it failed, no hint of a file or module name. "Compiler errors" with no further detail is not helpful, leading to a multi-day investigation full of trial and error.

    I did finally uncover the issue.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So a new/empty project didn't work either? What was the issue?
     
  10. federicobendinelli

    federicobendinelli

    Joined:
    Apr 8, 2022
    Posts:
    3
    I had that problem too on all editor-related files, i just canceled them before definitive build