On the Internet, there are instructions on how to add AdMob ads to the libgdx project, but to Eclipse. And I made a game in Android Studio, I need to add a line (compile 'com.google.android.gms: play-services-ads: 8.4.0') in gradle, but where I didn’t insert everywhere the error crashes (inserted into project ( ": android") {// dependencies {). In eclipse, instead, you had to specify a folder (google_play_services). here is my grad.android:
buildscript { repositories { mavenCentral() mavenLocal() } dependencies { classpath 'com.android.tools.build:gradle:1.1.0' } } allprojects { apply plugin: "eclipse" apply plugin: "idea" version = '1.0' ext { appName = 'Boom-Boom' gdxVersion = '0.9.9' roboVMVersion = '0.0.13' } repositories { mavenLocal() mavenCentral() maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url "https://oss.sonatype.org/content/repositories/releases/" } } } project(":desktop") { apply plugin: "java" dependencies { compile project(":core") compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" } } project(":android") { apply plugin: "android" configurations { natives } dependencies { compile project(":core") compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi" natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" compile fileTree(dir: '../libs', include: '*.jar') compile 'com.google.android.gms:play-services-ads:8.4.0' //тут ошибку выдает } } project(":core") { apply plugin: "java" dependencies { compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile fileTree(dir: '../libs', include: '*.jar') } } tasks.eclipse.doLast { delete ".project" }
(compile 'com.google.android.gms:play-services-ads:8.4.0')
in the place of dependencies and make synchronization. Ps gradle local - Silento