Search code examples
androidlibgdx

Import BaseGameUtils in Android Studio with libgdx


I'm trying to integrate Google Play Games in a libgdx project. All the tutorials found around the internet are either old or incorrect, also they're based on Eclipse.

My problem is that it seems like the BaseGameUtils module won't compile due to some incompatibility, which I'm not able to undestand.

The procedure I've followed is the standard one:

1) I've downloaded the BaseGameUtils module, available here

2) I've imported it as a module in my project with File -> New -> Import Module...

3) I've added the dependency in my build.gradle (Module:android) as

dependencies {
    compile 'com.google.android.gms:play-services-games:8.4.0'
    compile(':BaseGameUtils')
}

When I try to sync and build, I'm getting this error:

Error:(5, 5) uses-sdk:minSdkVersion 1 cannot be smaller than version 7 declared in library [my game path]\BaseGameUtils\build\intermediates\exploded-aar\com.android.support\appcompat-v7\20.0.0\AndroidManifest.xml

How can I fix that? Any help would be really appreciated!


Solution

  • The error suggests that you have a smaller sdk version decalred than the one your library supports.

    Try modifying the minSdkVersion on your Gradle file so that it matches the one your library requires. (In your case 7).