Mino
Mino

Reputation: 264

Google Play Game Services + BaseGameUtils added to a Gradle project = package does not exist

I already read many answers on this subject but can't fix my problem, and here it is :

I have a gradle project that is a game, in that game I want to add google game services like I successfully did with 'type-a-number' (which is NOT a gradle project).

But I get the following error:

Gradle: error: package com.google.example.games.basegameutils does not exist
Gradle: error: cannot find symbol class BaseGameActivity
Gradle: error: cannot find symbol variable super

NOTE : in my activity everything that was red because of coming from BaseGameUtils change to normal after the following :

(one time with :libraries, one time without)

Nothing listed above worked..

What I'm doing wrong ?

What I'm missing ?

Upvotes: 3

Views: 4237

Answers (2)

jp093121
jp093121

Reputation: 1762

When I was following the step-by-step here: https://developers.google.com/games/services/android/init

I was hung up on:

dependencies {
    compile project(':BaseGameUtils')
    // ...
}

and I just needed to change it to:

dependencies {
    compile project(':libraries:BaseGameUtils')
    // ...
}

hope that helps someone :)

Upvotes: 0

ianhanniballake
ianhanniballake

Reputation: 199805

Your settings.gradle should be:

include ':MyModule', ':BaseGameUtils'

Note the comma.

Your build.gradle for MyModule should also have

dependencies {
    compile 'com.android.support:support-v4:18.+'
    compile 'com.google.android.gms:play-services:3.+'
    compile project(':BaseGameUtils')
}

Upvotes: 5

Related Questions