Reputation: 1218
I want to use game api in my android project.
And I get started by following the instructions described in Google Site (the part - Setting up your game project) from the following link. https://developers.google.com/games/services/android/init
I have downloaded the library BaseGameUtils from this link https://github.com/playgameservices/android-samples
Then I import it as a project as described in instruction.
However, what I've got is a project named main but not BaseGameUtils.
And then I cannot called its BaseGameActivity in my android project.
How can I solve it?
Upvotes: 3
Views: 3057
Reputation: 2468
This is the original Directory structure from this playgameservices github link
android-basic-samples->BasicSamples->libraries->BaseGameUtils->
Change your BaseGameUtils project directory structure to this:
Apply & OK.
Now BaseGameUtils is linked with your project
Upvotes: 0
Reputation: 11
SOLVED.
You must follow: From the command line run Scripts/make_eclipse_compat (or Scripts/make_eclipse_compat.cmd on Windows). This creates the directory structure needed to import the projects correctly. Attention: android-basic-samples-master > Script/make_eclipse_compat.cmd
Ref: https://github.com/playgameservices/android-basic-samples
Upvotes: 1
Reputation: 13
This worked for me:
Download code from github, https://github.com/playgameservices/android-basic-samples In the downloaded folder copy the files from
android-basic-samples-master\BasicSamples\libraries\BaseGameUtils\src\main\java
to
android-basic-samples-master\BasicSamples\libraries\BaseGameUtils\src\main\src
Now import android-basic-samples-master as an android project.
Choose only BaseGameUtils , you'll get a project called main, right click project > properties > android Add library and select google-play-services_lib and also tick isLibrary and OK.
Also add an external jar android-support-v4.jar by right clicking project > properties > Java Build Path > Add external Jar .
Now add this project named main to your actual project as a library. TADA !
Upvotes: 1
Reputation: 39881
Adding to SEG.Veenstra's answer "....just imported and then go to properties > android and check "is library" you are able to refer to it in your app project" this link as there are problems in Google's documentation: Android Play Services Leaderboard cannot be installed (BaseGameUtils)
Upvotes: 0
Reputation: 728
Same issue solved differently.
I've imported the BaseGameUtils project and also couldn't refer to it. If you right-click the BaseGameUtils project that you've just imported and then go to properties > android and check "is library" you are able to refer to it in your app project.
Upvotes: 3
Reputation: 1218
Solved.
When importing project, not to select BaseGameUtils folder, but the root folder 'android-samples-master'. Then check the project named BaseGameUtils.
Upvotes: 2