2017-04-02 269 views
0

我正在創建一個統一的2D遊戲,並且遇到了問題。我已經創建了一個谷歌播放開發者帳戶,併發布我的遊戲谷歌播放封閉的阿爾法。我現在將Google Play遊戲服務添加到遊戲中,並且我從最新的圖書館(https://github.com/playgameservices/play-games-plugin-for-unity)下載並將其導入Unity。我已經設置了一切,但嘗試登錄時遊戲崩潰。登錄Google Play遊戲服務後遊戲崩潰

using UnityEngine; 
using GooglePlayGames; 
using GooglePlayGames.BasicApi; 
using UnityEngine.SocialPlatforms; 
using System.Collections; 

public class gpgTest : MonoBehaviour { 
    void Start() { 
     PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() 
     // enables saving game progress. 
     .EnableSavedGames() 
     // require access to a player's Google+ social graph (usually not needed) 
     .RequireGooglePlus() 
     .Build(); 
    PlayGamesPlatform.InitializeInstance(config); 
    // recommended for debugging: 
    PlayGamesPlatform.DebugLogEnabled = true; 
    // Activate the Google Play Games platform 
    PlayGamesPlatform.Activate(); 
} 

void Update() { 
} 

public void LogIn() 
{ 
    Debug.Log("button"); 
    // authenticate user: 
    Social.localUser.Authenticate((bool success) => { 
     // handle success or failure 
    }); 
} 
} 

注:我已經試過了圖書館幾乎所有版本,不同版本的統一5.0及以上。

我也得到這些消息: Unity console

而且我也安裝所有necesary包在SDK管理器。

回答

0

好吧,對於像我這樣掙扎的人來說,答案就是在\ Assets \ Plugins \ Android \中刪除版本10.2.1中的所有文件,並將其替換爲版本10.0.1中的版本。

來源:https://github.com/playgameservices/play-games-plugin-for-unity/issues/1604

總之:在玩遊戲的插件是不是新的庫兼容。

另一個相關主題:http://answers.unity3d.com/questions/1324988/android-game-crashes-on-startup-becaus-of-google-p.html

編輯:只有統一版本5.0 - 5.5的支持(現在)

相關問題