Search code examples
javagradlelibgdxchartboost

How to add Chartboost dependency to my LibGDX project?


I want to add Chartboost to my LibGDX game, but I don't know how to add it as a dependency to Gradle. Also, Chartboost uses Google Play Game Services, so I need to add both of them to Gradle. How can I do this?


Solution

  • it seems the chartboost jar is not published to a public maven repository so you need to reference it by file:

    dependency {
        // references a file relative to the project folder
        files('libs/chartboost.jar')
    }
    

    to add google play services you can use reference it like this:

    dependencies {
        // Google Play Services
        compile 'com.google.android.gms:play-services:5.0.77'
    
        // Note: these libraries require the "Google Repository" and "Android Repository"
        //       to be installed via the SDK manager.
    }