0

project level build.gradle file:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0'
        classpath 'com.google.gms:google-services:3.0.0'
   }
}
[...]

Application-level build.gradle (much abridged, due to large numbers of irrelevant dependencies here):

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.3"
}

ext {
    supportLibraryVersion = '24.2.1'
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
    compile 'com.google.android.gms:play-services-auth:9.8.0'
}

Gives me the following build errors:

google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used. please apply google-services plugin at the bottom of the build file.

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':app'.

    Could not resolve all dependencies for configuration ':app:_debugApkCopy'. Could not find com.google.android.gms:play-services-auth:9.8.0. Required by: SpeechDemo:app:unspecified

I tried moving the "apply plugin" line for google-services to the very bottom line of the file, but other than removing the warning about it this changed nothing.

Any ideas how to make this work?

Jules
  • 14,841
  • 9
  • 83
  • 130
  • Do you have the Android Support Repository downloaded? – Adam Gardner Feb 09 '17 at 01:59
  • Disagree with the marking of this as a duplicate. The error message is not the same, and the accepted answer specifies a change that I have already tried and which has not resolved the issue (a fact which is noted in the question description). – Jules Feb 09 '17 at 03:05
  • @AdamGardner - Yes, although it turned out that the copy I have (installed less than a month ago) is too old to work with the documentation up on the web site any more. – Jules Feb 09 '17 at 03:08

0 Answers0