java - Failed to resolve: com.google.android.gms:play-services in IntelliJ Idea with gradle -
i'm trying add google play services libgdx project in intellij idea. i've followed setup guide here: https://developers.google.com/android/guides/setup
which looks pretty straightforward. added lines build.gradle in corresponding section, things like:
project(":android") { apply plugin: "android" apply plugin: 'com.android.application' 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-arm64-v8a" natives "com.badlogicgames.gdx:gdx-platform:$gdxversion:natives-x86" natives "com.badlogicgames.gdx:gdx-platform:$gdxversion:natives-x86_64" compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxversion" natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxversion:natives-armeabi" natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxversion:natives-armeabi-v7a" natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxversion:natives-x86" compile "com.badlogicgames.gdx:gdx-freetype:$gdxversion" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxversion:natives-armeabi" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxversion:natives-armeabi-v7a" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxversion:natives-arm64-v8a" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxversion:natives-x86" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxversion:natives-x86_64" compile 'com.google.android.gms:play-services:11.2.0' } } then try sync gradle project in idea "failed resolve" error.
well, setup guide says "be sure update version number each time google play services updated", problem seems impossible find version number: google play services sdk version according android sdk manager "43", , far have been unable correlate such "11.2.0" or whatever typical version string "43" version number. not setup guide says nothing that.
anyway, have tried lot of things plethora of questions related no avail. specifically, have point out have android sdk updated , i'm sure 1 it's being used idea (i've triple-checked this...):
i'm using api level 26, anyway other defines use same directory android sdk. moreover, not have other android sdk installed @ in laptop, there's no question idea being using 1 , 1 only.
any ideas more welcome.
thanks in advance!
i replaced version 11.2.0 11.0.0 , seemed work fine, had mean 11.2.0 wasn't included latest android sdk.
so, after struggling available scattered documentation, reached document pure chance (i guess not indexed high enough google): https://developers.google.com/android/guides/releases
i quote there:
highlights google play services 11.2 release. google play services dependencies available via maven.google.com
now, when shouldn't mean not available downloaded sdk anymore, seems case.
anyway, adding google() build.gradle didn't work (not found, undefined, or whatever...), used different approach found in document referenced previous one:
https://developer.android.com/studio/build/dependencies.html#google-maven
i modified build.gradle file adding line allprojects/repositories, in:
allprojects { ... repositories { ... maven { url "https://maven.google.com/"} } } and in android section in same build.gradle file:
project(":android") { ... dependencies { ... compile 'com.google.android.gms:play-services-ads:11.2.0' } } those 2 lines enough make gradle sync without problems. didn't need add plugins apart ones added in libgdx project default.
after that, got few different errors, none gradle or dependencies. in brief, jftr:
first, had minsdkversion of 8. solved raising 14. think live without supporting devices below 14.
second, had problems dex upper limit of references. i've never faced problem before, maybe you've noticed solution used: instead of compiling whole 'com.google.android.gms:play-services' used 'com.google.android.gms:play-services-ads' that's api i'm interested right now. other particular cases solution may not useful, document provide better insight: https://developer.android.com/studio/build/multidex.html
third, after got "jumbo" thing problem described , answered here: https://stackoverflow.com/a/26248495/1160360
and that's it. of now, builds , game shows admob banners.
i've spent hours this, thought, makes me wonder if these building automation systems using lately worth load add.
i mean, first time had add admob app 5 years ago or so, had download .jar file , put on directory on project. pretty obvious , whole process, googling "how setup admob in android project" have app showing admob banner took me few minutes. i'm gonna leave here, since not place such kind of debate.
nonetheless, hope own experience useful else further.


Comments
Post a Comment