Reputation: 183
I am experiencing issues with creating a project that uses google play services in Android Studio. I am able to import com.google.android.gms, but nothing else. after I hit . after gms, I get the options of importing * or R. There is no option for GoogleMap, GooglePlayServicesUtil, etc.
I have tried quite a few different things, and have scrapped the project multiple times and started from scratch. At first I attempted to import the google-play-services_lib as a module into the project, but that did nothing, and after reading for a while I found that this was the incorrect way to do it.
I have since tried this (which seems to be the correct way) but it still is not working.
Code from Gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 18
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 14
targetSdkVersion 18
}
}
dependencies {
compile 'com.google.android.gms:play-services:3.2.65'
}
As I mentioned, I do not have any error with the compile line. In fact, 'intellisense' detects com.google.android.gms. Just nothing after that, so I can't import anything useful.
Any help would be greatly appreciated. I have been banging my head against a wall with this. It would help to have a fresh set of eyes.
Thanks!
Upvotes: 0
Views: 2439
Reputation: 5721
Google Play services Integration.
Step 1:
SDK manager->Tools Update this
1.Google play services
2.Android Support Repository
Step 2:
chance in build.gradle
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:4.0.+'
}
Step 3:
android.manifest.xml
<uses-sdk
android:minSdkVersion="8" />
Step 4:
Sync project file with grandle.
wait for few minute.
Step 5:
File->Project Structure find error with red bulb images,click on go to add dependencies select your app module.
Save
Please put comment if you have require help. Happy coding.
Upvotes: 0
Reputation: 22232
It needs to Sync project with gradle files
everytime you edit build.gradle
so AndroidStudio can fetch the changes.
Note, that your build tools are outdated:
android {
buildToolsVersion "18.1.1"
}
Upvotes: 2