Failed to resolve: com.google.android.gms:play-services in IntelliJ Idea with gradle

前端 未结 13 1892
一向
一向 2020-12-02 11:09

I\'m trying to add google play services to my libGDX project in IntelliJ Idea. I\'ve followed the setup guide here: https://developers.google.com/android/guides/setup

<
相关标签:
13条回答
  • 2020-12-02 11:51

    I got this error too but for a different reason. It turns out I had made a typo when I tried to specify the version number as a variable:

    dependencies {
        // ...
        implementation "com.google.android.gms:play-services-location:{$playServices}"
        // ...
    }
    

    I had defined the variable playServices in gradle.properties in my project's root directory:

    playServices=15.0.1
    

    The typo was {$playServices} which should have said ${playServices} like this:

    dependencies {
        // ...
        implementation "com.google.android.gms:play-services-location:${playServices}"
        // ...
    }
    

    That fixed the problem for me.

    0 讨论(0)
提交回复
热议问题