TapTapTap!!!(16)~Google Play Services がインポートできない~
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/08/taptaptapIcon.png?fit=512%2C512&ssl=1)
TapTapTap!!!(15)~ゲームのビルドを行う~では Google Play に公開するようのプログラムをビルドした。今回は Google Play 上で実績およびランキング機能を実装するためにGoogle Play Servicesをインポートしようと思ったがエラーになった。
ブログを書きながらゲーム制作を進めていたところエラーになった話。
PC環境は以下の通り。
OS:Windows7 Home Premium(64ビット)
CPU:Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8GB)
Unity:5.6.3p2
以下途中まで記載中だった記事。
Google Play で実績およびランキング機能を用いるには Google が公開している。Google Play Services を用いるのが良いだろう。今回はこの Google Play Services 用いて実績およびランキング機能を実装していく。ページを開くと以下の画面が表示される。
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/09/GooglePlayServices-300x199.png?resize=300%2C199)
1.Unity 用の Google Play Services をダウンロードする
Google Play Services は Google Play Services トップページの「DOWNLOADS」からダウンロードすることができる。「DOWNLOAD」をクリックすると以下のページが表示される。
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/09/UnityPulgin-300x189.png?resize=300%2C189)
このページではサンプルなどいろいろダウンロードできるが、今回は赤枠の「Unity Plugin」をクリックし、以下の [GitHub] ページを表示する。
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/09/zipDownloads-300x260.png?resize=300%2C260)
「Clone or Download」 から「play-games-plugin-for-unity-master.zip」 ファイルをダウンロードする。ファイルを解凍すると以下の内容物があるはずだ。
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/09/zipimport-300x201.png?resize=300%2C201)
2.解凍したデータをUnityに適応する
解凍したデータをUnityに適応するためには [Assets] > [Import Package] > [Custom Package]から使用する
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/09/CustomPackage-300x163.png?resize=300%2C163)
インポートするデータは解凍したデータ内、「current-build」 フォルダ内にある「GooglePlayGamesPlugin-0.9.50.unitypackage」を選択する。
選択するとUnity上で以下の画面が表示されるのでとりあえず、全てインポートしておく。
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/09/GooglePlayImport-284x300.png?resize=284%2C300)
すべてを選択し、[Import]ボタンをクリックすると以下の画面が表示される。何が書いてあるかというと「新しくインポートしたら Google Play Games の Android Setupを実行してくれ」ということらしいので[OK]ボタンをクリックして次に進む。
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/09/GooglePlayGamesInfomation-300x123.png?resize=300%2C123)
インポートが完了すると以下の「GooglePlayGames」と「PlayServicesResolver」、「Plugins」が追加されているはずだ。
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/09/InportedFolders-300x290.png?resize=300%2C290)
上記の指示通り。「GooglePlayGames」のセットアップをやろうとしたところ、コンソール画面を確認したらいくつかエラーが表示されていた。まずはこれを解決しなければならない。
![](https://i0.wp.com/studiofun.site/wp-content/uploads/2018/09/ImportError-300x55.png?resize=300%2C55)