Android版谷歌工作室播放服务没有自动完成 [英] Android Studio Google Play Services no autocomplete
问题描述
我用AS 0.4.2然后导入GMS如DOC描述:
https://developer.android.com/google/play-services/setup.html
I use AS 0.4.2 then imported GMS as described in doc: https://developer.android.com/google/play-services/setup.html
dependencies {
compile 'com.android.support:support-v4:19.0.0'
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:support-v13:13.0.+'
compile 'com.google.android.gms:play-services:4.0.30' }
到底什么是IDE检测为R级,但code的其余部分是看不见的。
在另一方面,我就把下面code:
all what is detected by IDE is R class, but rest of code is invisible. On the other hand I put following code:
import com.google.android.gms.common.GooglePlayServicesUtil;
(...)
private void connectGms(){
Log.d(MbcConstants.TAG,
"check for gms"+ GooglePlayServicesUtil.
isGooglePlayServicesAvailable(this));
}
和它的工作原理,但IDE仍然显示类名红,但正确显示PARAMS和方法的返回类型。
And it works, but IDE still shows class name in red, but properly shows the params and returned type for method.
推荐答案
确定 - 它看起来像在Android Studio中的错误。
我做了什么做修正:
从项目和模块中删除所有的依赖(使用F4键)
从projectroot / .idea /库中删除文件
Ok - it seems like a bug in Android studio. What I've done do fix it: remove all dependencies (use F4 key) from project and the module delete files from projectroot/.idea/libraries
打开模块gradle.buld
open the module gradle.buld
添加回由你的项目需要工作的所有依赖。在我的情况:
add back all dependencies that are needed by your project to work. In my case:
dependencies {
compile 'com.android.support:support-v4:19.0.0'
compile 'com.android.support:appcompat-v7:19.0.0'
compile 'com.google.android.gms:play-services:4.0.30'
}
同步gradle.build再次
Synchronize gradle.build once again
继续你的爱的冒险与恨或返回到日食。
Continue your adventure of love and hate or return to eclipse.
这篇关于Android版谷歌工作室播放服务没有自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!