Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Trouble with Google Play Games: The name 'PlayGamesPlatform' does not exist in the current context

Discussion in 'Unity Build Automation' started by japtar10101, Oct 23, 2016.

  1. japtar10101

    japtar10101

    Joined:
    Mar 13, 2010
    Posts:
    138
    I've recently had trouble with Unity Cloud on a repo that has Google Play Games Service Unity plugin, version 0.9.34. The error, of course, is:
    The script-in-question, though, compiles just fine on my computer, and not only that, the target this is running on has been building just fine until recently. The only configuration setting I'm aware of changing is the Unity version. What's going on?

    Here's the SocialManager.cs:
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.SocialPlatforms;
    3. using System;
    4. using System.Collections.Generic;
    5.  
    6. // Import other packages specific to device
    7. #if GOOGLE_PLAY_GAMES
    8. // importing Google Play Games here
    9. using GooglePlayGames;
    10. using GooglePlayGames.BasicApi;
    11. #elif UNITY_IOS
    12. using UnityEngine.SocialPlatforms.GameCenter;
    13. #endif
    14.  
    15. namespace OmiyaGames
    16. {
    17.     ///-----------------------------------------------------------------------
    18.     /// <copyright file="SocialManagerWrapperClasses.cs" company="Omiya Games">
    19.     /// The MIT License (MIT)
    20.     ///
    21.     /// Copyright (c) 2014-2016 Omiya Games
    22.     ///
    23.     /// Permission is hereby granted, free of charge, to any person obtaining a copy
    24.     /// of this software and associated documentation files (the "Software"), to deal
    25.     /// in the Software without restriction, including without limitation the rights
    26.     /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    27.     /// copies of the Software, and to permit persons to whom the Software is
    28.     /// furnished to do so, subject to the following conditions:
    29.     ///
    30.     /// The above copyright notice and this permission notice shall be included in
    31.     /// all copies or substantial portions of the Software.
    32.     ///
    33.     /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    34.     /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    35.     /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    36.     /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    37.     /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    38.     /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    39.     /// THE SOFTWARE.
    40.     /// </copyright>
    41.     /// <author>Taro Omiya</author>
    42.     /// <date>4/14/2016</date>
    43.     ///-----------------------------------------------------------------------
    44.     /// <summary>
    45.     /// Singleton file used to authenticate with various social platforms.
    46.     /// It also provides a social platform agnostic interface to report to
    47.     /// leaderboards and achievements.
    48.     /// <code>Singleton</code>'s events.
    49.     /// </summary>
    50.     /// <seealso cref="UnityEngine.SocialPlatforms"/>
    51.     public class SocialManager : ISingletonScript
    52.     {
    53.         public enum LogInState
    54.         {
    55.             NotConnected,
    56.             MiddleOfAuthenticating,
    57.             AuthenticationSuccess
    58.         }
    59.  
    60.         public enum ServiceType
    61.         {
    62.             None = -1,
    63.             AppleGameCenter = 0,
    64.             GooglePlayGames,
    65.             AmazonGameCircle,
    66.             //XboxLive,
    67.             //Newgrounds,
    68.             //GameJolt,
    69.             //Kongregate,
    70.             NumberOfServiceTypes
    71.         }
    72.  
    73. #if UNITY_EDITOR
    74.         class DebugSequence
    75.         {
    76.             uint index = 0;
    77.             readonly float[] secondsSequence = new float[] { 15f, 0.1f, 0.2f };
    78.             readonly bool[] successSequence = new bool[] { true, true, false };
    79.  
    80.             public void Next()
    81.             {
    82.                 ++index;
    83.             }
    84.  
    85.             public float WaitForSeconds
    86.             {
    87.                 get
    88.                 {
    89.                     return secondsSequence[index % secondsSequence.Length];
    90.                 }
    91.             }
    92.  
    93.             public bool ReportedSuccess
    94.             {
    95.                 get
    96.                 {
    97.                     return successSequence[index % successSequence.Length];
    98.                 }
    99.             }
    100.         }
    101.  
    102.         readonly DebugSequence sequence = new DebugSequence();
    103. #endif
    104.  
    105.         [SerializeField]
    106.         bool authenticateOnStartUp = true;
    107.         [SerializeField]
    108.         bool showAchievementBannerOnStartUp = true;
    109.         [SerializeField]
    110.         int numberOfAuthenticationRetries = 3;
    111.  
    112.         [Header("Leaderboard IDs")]
    113.         [Tooltip("The first leaderboard listed will be considered the default leaderboard to report to.")]
    114.         [SerializeField]
    115.         ServiceSpecificIds[] leaderboardIds;
    116.  
    117.         [Header("Achievement IDs")]
    118.         [SerializeField]
    119.         ServiceSpecificIds[] achievementIds;
    120.  
    121.         readonly Dictionary<LeaderboardKey, ILeaderboardWrapper> allLeaderboards = new Dictionary<LeaderboardKey, ILeaderboardWrapper>();
    122.         readonly Dictionary<string, ServiceSpecificIds> leaderboardIdsMap = new Dictionary<string, ServiceSpecificIds>();
    123.         readonly Dictionary<string, ServiceSpecificIds> achievementIdsMap = new Dictionary<string, ServiceSpecificIds>();
    124.         readonly System.Text.StringBuilder warningBuilder = new System.Text.StringBuilder();
    125.         LogInState authenticationState = LogInState.NotConnected;
    126.         Action<float> onUpdate = null;
    127.         Action<bool> onAchievementReported = null, onLeaderboardReported = null;
    128.  
    129.         #region Properties
    130.         public LogInState CurrentLogInState
    131.         {
    132.             get
    133.             {
    134.                 LogInState returnState = authenticationState;
    135.                 if (authenticationState == LogInState.AuthenticationSuccess)
    136.                 {
    137.                     if (Social.localUser.authenticated == true)
    138.                     {
    139.                         returnState = LogInState.AuthenticationSuccess;
    140.                     }
    141.                     else
    142.                     {
    143.                         returnState = LogInState.NotConnected;
    144.                     }
    145.                 }
    146.                 return returnState;
    147.             }
    148.             private set
    149.             {
    150.                 authenticationState = value;
    151.             }
    152.         }
    153.  
    154.         public ServiceSpecificIds DefaultLeaderboardIds
    155.         {
    156.             get
    157.             {
    158.                 ServiceSpecificIds returnId = null;
    159.                 if (leaderboardIds.Length > 0)
    160.                 {
    161.                     returnId = leaderboardIds[0];
    162.                 }
    163.                 return returnId;
    164.             }
    165.         }
    166.  
    167.         public static bool IsSupported
    168.         {
    169.             get
    170.             {
    171.                 return (CurrentService != ServiceType.None);
    172.             }
    173.         }
    174.  
    175.         public static ServiceType CurrentService
    176.         {
    177.             get
    178.             {
    179.                 // TODO: as more services are implemented in SetupPlatformSpecificServices(),
    180.                 // add more supported services below here
    181. #if (UNITY_EDITOR || DEMO)
    182.                 // In the editor or demo, don't allow any leaderboard services
    183.                 return ServiceType.None;
    184. #elif GOOGLE_PLAY_GAMES
    185.                 return ServiceType.GooglePlayGames;
    186. #elif UNITY_IOS
    187.                 return ServiceType.AppleGameCenter;
    188. #else
    189.                 return ServiceType.None;
    190. #endif
    191.             }
    192.         }
    193.  
    194.         static void SetupPlatformSpecificServices()
    195.         {
    196.             // Check if we need to do anything special based on platform
    197. #if GOOGLE_PLAY_GAMES
    198.             // Activate the Google Play Games platform
    199.             PlayGamesPlatform.DebugLogEnabled = Debug.isDebugBuild;
    200.             PlayGamesPlatform.Activate();
    201. #endif
    202.         }
    203.         #endregion
    204.  
    205.         public bool LogInAsync(bool forceLogin = false)
    206.         {
    207.             bool returnIsAttemptingAuthentication = false;
    208.  
    209.             if ((IsSupported == true) && ((CurrentLogInState == LogInState.NotConnected) || (forceLogin == true)))
    210.             {
    211.                 // Setup any platform specific quirks
    212.                 SetupPlatformSpecificServices();
    213.  
    214.                 // Check if this manager supports this specific platform
    215.                 CurrentLogInState = LogInState.NotConnected;
    216.  
    217.                 // Setup all flags
    218.                 returnIsAttemptingAuthentication = true;
    219.                 CurrentLogInState = LogInState.MiddleOfAuthenticating;
    220.  
    221.                 // Start authentication process
    222.                 if (Debug.isDebugBuild == true)
    223.                 {
    224.                     Debug.Log("Starting authentication!");
    225.                 }
    226.                 Social.localUser.Authenticate(OnAuthenticationComplete);
    227.             }
    228.             return returnIsAttemptingAuthentication;
    229.         }
    230.  
    231.         public ServiceSpecificIds GetLeaderboardIds(string key)
    232.         {
    233.             return GetIds(key, leaderboardIdsMap, leaderboardIds);
    234.         }
    235.  
    236.         public ServiceSpecificIds GetAchievementIds(string key)
    237.         {
    238.             return GetIds(key, achievementIdsMap, achievementIds);
    239.         }
    240.  
    241.         public bool ReportAchievementProgressAsync(double record, string achievementKey, Action<bool> onResultsReceived = null)
    242.         {
    243.             bool returnIsAttemptingReport = false;
    244.             ServiceSpecificIds requestedAchievementIds = null;
    245.  
    246.             // Clamp record
    247.             if (record < 0)
    248.             {
    249.                 record = 0;
    250.             }
    251.             else if (record > 100)
    252.             {
    253.                 record = 100;
    254.             }
    255.  
    256.             // Grab an achievement
    257.             if (string.IsNullOrEmpty(achievementKey) == false)
    258.             {
    259.                 requestedAchievementIds = GetAchievementIds(achievementKey);
    260.             }
    261.  
    262.             // Make sure all the parameters are correct
    263.             if (IsArgumentValid<double>("Achievement", requestedAchievementIds, achievementKey, record, onResultsReceived) == true)
    264.             {
    265.                 // Grab the action to report to
    266.                 if (onResultsReceived == null)
    267.                 {
    268.                     if (onAchievementReported == null)
    269.                     {
    270.                         onAchievementReported = new Action<bool>(OnAchievementReported);
    271.                     }
    272.                     onResultsReceived = onAchievementReported;
    273.                 }
    274.  
    275.                 // Report score
    276.                 Social.ReportProgress(requestedAchievementIds.Id, record, onResultsReceived);
    277.  
    278.                 // Indicate attempt succeeded
    279.                 returnIsAttemptingReport = true;
    280.  
    281.                 // Show debugging messages
    282.                 if (Debug.isDebugBuild == true)
    283.                 {
    284.                     lock (warningBuilder)
    285.                     {
    286.                         warningBuilder.Length = 0;
    287.                         warningBuilder.Append("Reporting Achievement with key ");
    288.                         warningBuilder.Append(achievementKey);
    289.                         warningBuilder.Append(" and progress ");
    290.                         warningBuilder.Append(record);
    291.                         Debug.Log(warningBuilder.ToString());
    292.                     }
    293.                 }
    294.             }
    295.             return returnIsAttemptingReport;
    296.         }
    297.  
    298.         public bool RevealHiddenAchievementAsync(string achievementKey, Action<bool> onResultsReceived = null)
    299.         {
    300.             return ReportAchievementProgressAsync(0, achievementKey, onResultsReceived);
    301.         }
    302.  
    303.         public bool UnlockAchievementAsync(string achievementKey, Action<bool> onResultsReceived = null)
    304.         {
    305.             return ReportAchievementProgressAsync(100, achievementKey, onResultsReceived);
    306.         }
    307.  
    308.         public bool ReportLeaderboardRecordAsync(long record, string leaderboardKey = null, Action<bool> onResultsReceived = null)
    309.         {
    310.             bool returnIsAttemptingReport = false;
    311.             ServiceSpecificIds requestedLeaderboardIds = DefaultLeaderboardIds;
    312.             if (string.IsNullOrEmpty(leaderboardKey) == false)
    313.             {
    314.                 requestedLeaderboardIds = GetLeaderboardIds(leaderboardKey);
    315.             }
    316.  
    317.             // Make sure all the parameters are correct
    318.             if (IsArgumentValid<long>("Leaderboard", requestedLeaderboardIds, leaderboardKey, record, onResultsReceived) == true)
    319.             {
    320.                 // Grab the action to report to
    321.                 if (onResultsReceived == null)
    322.                 {
    323.                     if (onLeaderboardReported == null)
    324.                     {
    325.                         onLeaderboardReported = new Action<bool>(OnLeaderboardReported);
    326.                     }
    327.                     onResultsReceived = onLeaderboardReported;
    328.                 }
    329.  
    330.                 // Report score
    331.                 Social.ReportScore(record, requestedLeaderboardIds.Id, onResultsReceived);
    332.  
    333.                 // Indicate attempt succeeded
    334.                 returnIsAttemptingReport = true;
    335.  
    336.                 // Show debugging messages
    337.                 if (Debug.isDebugBuild == true)
    338.                 {
    339.                     lock (warningBuilder)
    340.                     {
    341.                         warningBuilder.Length = 0;
    342.                         warningBuilder.Append("Reporting Leaderboard with key ");
    343.                         warningBuilder.Append(leaderboardKey);
    344.                         warningBuilder.Append(" and score ");
    345.                         warningBuilder.Append(record);
    346.                         Debug.Log(warningBuilder.ToString());
    347.                     }
    348.                 }
    349.             }
    350.             return returnIsAttemptingReport;
    351.         }
    352.  
    353.         public ILeaderboardWrapper GetLeaderboard(string leaderboardKey = null,
    354.             UserScope? userScope = null, TimeScope timeScope = TimeScope.AllTime,
    355.             ushort startingRank = 0, ushort numberOfRanks = 0, bool retrieveScore = true)
    356.         {
    357.             ILeaderboardWrapper returnWrapper = null;
    358.             ServiceSpecificIds leaderboardIds = DefaultLeaderboardIds;
    359.             if (string.IsNullOrEmpty(leaderboardKey) == false)
    360.             {
    361.                 leaderboardIds = GetLeaderboardIds(leaderboardKey);
    362.             }
    363.  
    364.             // Check if the user scope is provided
    365.             if (userScope.HasValue == false)
    366.             {
    367.                 // If not, replace this parameter with default leaderboard ID
    368.                 userScope = Singleton.Get<GameSettings>().LeaderboardUserScope;
    369.             }
    370.  
    371.             // Check if the ID is provided
    372.             if (leaderboardIds == null)
    373.             {
    374.                 if (Debug.isDebugBuild == true)
    375.                 {
    376.                     Debug.LogWarning("No Leaderboard with key " + leaderboardKey + " found");
    377.                 }
    378.             }
    379.             else if (string.IsNullOrEmpty(leaderboardIds.Id) == true)
    380.             {
    381.                 if (Debug.isDebugBuild == true)
    382.                 {
    383.                     Debug.LogWarning("No Leaderboard ID provided");
    384.                 }
    385.             }
    386.             else
    387.             {
    388.                 // Find a LeaderboardWrapper from the dictionary
    389.                 LeaderboardKey key = new LeaderboardKey(leaderboardIds.Id, userScope.Value, timeScope, startingRank, numberOfRanks);
    390.                 if (allLeaderboards.TryGetValue(key, out returnWrapper) == false)
    391.                 {
    392.                     // Create a new wrapper, and add it to the dictionary
    393.                     returnWrapper = new LeaderboardWrapper(key);
    394.                     allLeaderboards.Add(key, returnWrapper);
    395.  
    396.                     // Check if we should retrive scores for this leaderboard
    397.                     if ((retrieveScore == true) && (CurrentLogInState == LogInState.AuthenticationSuccess))
    398.                     {
    399.                         returnWrapper.LoadLeaderboardAsync();
    400.                     }
    401.                 }
    402.             }
    403.             return returnWrapper;
    404.         }
    405.  
    406.         #region Singleton Overrides
    407.         public override void SingletonAwake(Singleton instance)
    408.         {
    409.             // Setup flag
    410.             CurrentLogInState = LogInState.NotConnected;
    411.  
    412.             // Setup Banner
    413.             SetupAchievementBanner(showAchievementBannerOnStartUp);
    414.  
    415.             // If this script is enabled, start authentication
    416.             if ((authenticateOnStartUp == true) && (IsSupported == true))
    417.             {
    418.                 // Sign to Singleton's update function
    419.                 OnDestroy();
    420.                 onUpdate = new System.Action<float>(OnEveryFrame);
    421.                 instance.OnUpdate += onUpdate;
    422.             }
    423.         }
    424.  
    425.         public override void SceneAwake(Singleton instance)
    426.         {
    427.         }
    428.         #endregion
    429.  
    430.         #region Event Listeners
    431.         void OnDestroy()
    432.         {
    433.             if (onUpdate != null)
    434.             {
    435.                 Singleton.Instance.OnUpdate -= onUpdate;
    436.                 onUpdate = null;
    437.             }
    438.         }
    439.  
    440.         void OnEveryFrame(float deltaTime)
    441.         {
    442.             if (CurrentLogInState == LogInState.NotConnected)
    443.             {
    444.                 if (numberOfAuthenticationRetries > 0)
    445.                 {
    446.                     // Login
    447.                     LogInAsync(true);
    448.  
    449.                     // Decrement the number of attempts to authenticate
    450.                     --numberOfAuthenticationRetries;
    451.                 }
    452.                 else
    453.                 {
    454.                     // We've went through all the retries
    455.                     // Stop attempting to authenticate
    456.                     OnDestroy();
    457.                 }
    458.             }
    459.         }
    460.  
    461.         // This function gets called when Authenticate completes
    462.         // Note that if the operation is successful, Social.localUser will contain data from the server.
    463.         void OnAuthenticationComplete(bool success)
    464.         {
    465.             // Check if authentication succeeded
    466.             if (success == true)
    467.             {
    468.                 // Stop attempting to authenticate
    469.                 if (authenticateOnStartUp == true)
    470.                 {
    471.                     OnDestroy();
    472.                 }
    473.  
    474.                 // Indicate success
    475.                 CurrentLogInState = LogInState.AuthenticationSuccess;
    476.                 if (Debug.isDebugBuild == true)
    477.                 {
    478.                     Debug.Log("Authentication success!");
    479.                 }
    480.             }
    481.             else
    482.             {
    483.                 // Indicate failure
    484.                 CurrentLogInState = LogInState.NotConnected;
    485.                 if (Debug.isDebugBuild == true)
    486.                 {
    487.                     Debug.Log("Failed to authenticate");
    488.                 }
    489.             }
    490.         }
    491.  
    492.         void OnLeaderboardReported(bool success)
    493.         {
    494.             // Check if report succeeded
    495.             if (Debug.isDebugBuild == true)
    496.             {
    497.                 if (success == true)
    498.                 {
    499.                     Debug.Log("Successfully recorded to a leaderboard!");
    500.                 }
    501.                 else
    502.                 {
    503.                     Debug.Log("Failed to record to a leaderboard...");
    504.                 }
    505.             }
    506.         }
    507.  
    508.         void OnAchievementReported(bool success)
    509.         {
    510.             // Check if report succeeded
    511.             if (Debug.isDebugBuild == true)
    512.             {
    513.                 if (success == true)
    514.                 {
    515.                     Debug.Log("Successfully recorded to an achivement!");
    516.                 }
    517.                 else
    518.                 {
    519.                     Debug.Log("Failed to record to an achievement...");
    520.                 }
    521.             }
    522.         }
    523.         #endregion
    524.  
    525.         #region Helpers
    526.         static void SetupAchievementBanner(bool isVisible)
    527.         {
    528. #if !UNITY_EDITOR && UNITY_IOS
    529.             GameCenterPlatform.ShowDefaultAchievementCompletionBanner(isVisible);
    530. #endif
    531.         }
    532.  
    533.         ServiceSpecificIds GetIds(string key, Dictionary<string, ServiceSpecificIds> dictionary, ServiceSpecificIds[] list)
    534.         {
    535.             ServiceSpecificIds returnId = null;
    536.  
    537.             // First, check if the leaderboard dictionary needs to be populated
    538.             if (dictionary.Count != list.Length)
    539.             {
    540.                 dictionary.Clear();
    541.                 for (int index = 0; index < list.Length; ++index)
    542.                 {
    543.                     dictionary.Add(list[index].Key, list[index]);
    544.                 }
    545.             }
    546.  
    547.             // Next, see if we can grab a leaderboard
    548.             if (dictionary.TryGetValue(key, out returnId) == false)
    549.             {
    550.                 returnId = null;
    551.             }
    552.             return returnId;
    553.         }
    554.  
    555.         bool IsArgumentValid<T>(string type, ServiceSpecificIds ids, string achievementKey, T record, Action<bool> debug)
    556.         {
    557.             bool returnFlag = true;
    558.  
    559. #if UNITY_EDITOR
    560.             // Return false
    561.             returnFlag = false;
    562.  
    563.             // Pretend to run the results, anyway
    564.             StartCoroutine(DebugUnsupportedPlatforms<T>(achievementKey, record, debug));
    565. #else
    566.             if (ids == null)
    567.             {
    568.                 // Return false
    569.                 returnFlag = false;
    570.  
    571.                 // Generate warning
    572.                 lock(warningBuilder)
    573.                 {
    574.                     warningBuilder.Length = 0;
    575.                     warningBuilder.Append("No ");
    576.                     warningBuilder.Append(type);
    577.                     warningBuilder.Append(" with key ");
    578.                     warningBuilder.Append(achievementKey);
    579.                     warningBuilder.Append("found!");
    580.                     Debug.LogWarning(warningBuilder.ToString());
    581.                 }
    582.             }
    583.             else if (string.IsNullOrEmpty(ids.Id) == true)
    584.             {
    585.                 // Return false
    586.                 returnFlag = false;
    587.  
    588.                 // Generate warning
    589.                 lock (warningBuilder)
    590.                 {
    591.                     warningBuilder.Length = 0;
    592.                     warningBuilder.Append("No ");
    593.                     warningBuilder.Append(type);
    594.                     warningBuilder.Append(" ID provided");
    595.                     Debug.LogWarning(warningBuilder.ToString());
    596.                 }
    597.             }
    598.             else if (CurrentLogInState != LogInState.AuthenticationSuccess)
    599.             {
    600.                 // Return false
    601.                 returnFlag = false;
    602.  
    603.                 // Generate warning
    604.                 Debug.LogWarning("User is not authenticated yet");
    605.             }
    606. #endif
    607.             return returnFlag;
    608.         }
    609.  
    610. #if UNITY_EDITOR
    611.         System.Collections.IEnumerator DebugUnsupportedPlatforms<T>(string key, T record, Action<bool> debug)
    612.         {
    613.             sequence.Next();
    614.             float seconds = sequence.WaitForSeconds;
    615.             bool reportSuccess = sequence.ReportedSuccess;
    616.  
    617.             // Wait
    618.             yield return new WaitForSeconds(seconds);
    619.  
    620.             // Print info
    621.             if (Debug.isDebugBuild == true)
    622.             {
    623.                 lock (warningBuilder)
    624.                 {
    625.                     warningBuilder.Length = 0;
    626.                     warningBuilder.Append("Waited ");
    627.                     warningBuilder.Append(seconds);
    628.                     warningBuilder.Append(" seconds, pretending to report to ");
    629.                     warningBuilder.Append(key);
    630.                     warningBuilder.Append(" with record ");
    631.                     warningBuilder.Append(record);
    632.                     warningBuilder.Append(" and success ");
    633.                     warningBuilder.Append(reportSuccess);
    634.                     Debug.Log(warningBuilder.ToString());
    635.                 }
    636.             }
    637.             if (debug != null)
    638.             {
    639.                 debug(reportSuccess);
    640.             }
    641.         }
    642. #endif
    643.         #endregion
    644.     }
    645. }
    646.  
    And here's the target configuration:



    I've also attached the full log of the build and a few other scripts that might be relevant to SocialManager.cs. As far as I can tell, they have no compilation errors.
     

    Attached Files:

  2. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    785
    Can you try building with a different version of 5.4.x? I don't see UNITY_ANDROID in the list of defines that were printed out by Unity at compile time which makes me think maybe there is a problem with our install of 5.4.2f1.
     
  3. japtar10101

    japtar10101

    Joined:
    Mar 13, 2010
    Posts:
    138
    Yeah, I'll try Unity 5.4.1f1 and see what happens. Thanks for checking!
     
  4. japtar10101

    japtar10101

    Joined:
    Mar 13, 2010
    Posts:
    138
    Looks like it worked! Strange to see an installation problem like this...
     
  5. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    785
    Thanks for following up! Indeed that is strange to see. Will follow up and look into what happened with that install.
     
  6. dannyd

    dannyd

    Unity Technologies

    Joined:
    Jun 3, 2014
    Posts:
    785
    It looks like 5.4.2f1 was originally pulled from the main Unity download page because of installer issues. Unfortunately our build systems had already installed it at that point. We've replaced it with the recently released 5.4.2f2 so you shouldn't see issues building with that version (but please let me know if you do).
     
  7. squeegene

    squeegene

    Joined:
    Jun 30, 2016
    Posts:
    3
    Sorry for hijacking this thread, but I'm having the same issues with 5.4.2f2. The weird thing is, I can still build the game fine, and on my desktop computer there is no problem. On my laptop, I get the error 'The name PlayGamesPlatform' does not exist in the current context. The error only shows up in MonoDevelop. Any ideas?
     
  8. Thomas_K

    Thomas_K

    Joined:
    Mar 11, 2014
    Posts:
    1
    Dear Danny,

    I had the same problem in Unity 5.2.2f2 and it still remains after upgrading to 5.5.0f3.

    What I also figured out is that:

    Code (CSharp):
    1. PlayGamesPlatform.DebugLogEnabled = true;
    2.  
    In my case needs to be replaced with:

    Code (CSharp):
    1. GooglePlayGames.OurUtils.Logger.DebugLogEnabled = true;
    In order to work.

    Is there maybe a change in the APIs or the standard install procedure is somehow not applicable...?

    Can you help me with this issue?

    Thank you in advance,
    Thomas