The latest update to Android studio does not allow one to access the project structure GUI from a project that uses gradle. Although I have configured the gradle script to use google play services, for some reason I am still unable to use the library. Here is what I did:
apply plugin: 'android-library' buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4' } } dependencies { compile files('libs/google-play-services.jar') } android { compileSdkVersion 17 buildToolsVersion '17.0.0' sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aild.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } } }
5.) Edited my project's build.gradle with the following:
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4' } } apply plugin: 'android' dependencies { compile files('libs/android-support-v4.jar') compile project(':libraries:google-play-services') } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 15 targetSdkVersion 17 } }
6.) Changed my settings.gradle to the following
include ':Rimatyo', ':libraries:google-play-services'
Everything compiles fine, but I cam unable to access any Google play services class from my project. All the guides I've seen online utilize the project structure GUI, which isn't possible anymore. What am I missing?
EDIT: Was able to get around the problem by importing a google play service sample app posted by Xavier Ducrohet in the adt-dev Google group and refactoring everything to make it match my project structure. Not ideal, but everything is working.
There is now official support for Google Play services.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With