Reputation: 6676
I want to include Google Drive support in my application, using Android Studio 3.0.1
I have the following entries in my app' build.gradle file:
dependencies {
compile 'com.google.android.gms:play-services:+'
compile 'com.google.android.gms:play-services-drive:11.6.0'
When I try to do a Gradle build I get the following error:
When clicking on "Install Repository and sync project" I then get the following error:
Is the syntax of my dependencies section wrong?
Google shows use of the implementation
directive instead of compile
but doesn't work for me either.
I've tried changing the play-services-drive line to this:
compile 'com.google.android.gms:play-services-drive:+'
but then I get a load of resource errors that I've never seen before. This project built and ran before I started trying to add the Google imports below:
Errors:
Upvotes: 1
Views: 697
Reputation: 10185
Did follow step 4?
If you receive an error, check that your top-level build.gradle contains a reference to the google() repo or to maven { url "https://maven.google.com" }.
You would put this in your top-level build.gradle
file like so:
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Google's Play Services are often horribly documented. You should consult their demo project as a better reference as to how to use the APIs (that's where the sample code is from). Hope that helps!
Upvotes: 1