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

前端 未结 13 2003
一向
一向 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:37

    I had the issue when I put jcenter() before google() in project level build.gradle. When I changed the order and put google() before jcenter() in build.gradle the problem disappeared

    Here is my final build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
    
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.3'
    
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google()
            jcenter()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

提交回复
热议问题