导入游戏.请求 [英] Importing games.request
问题描述
我正在使用Android Studio
,并试图将Google Play游戏服务导入到我的应用程序中.
I'm using Android Studio
and tried to import Google Play Game Services into my application.
在库中导入了BaseGameUtils文件夹,现在在GameHelper类的以下行中出现错误:
Imported BaseGameUtils folder in the libraries and now I have an error at the following line, in the GameHelper class:
import com.google.android.gms.games.request.GameRequest;
确切地说,它是"cannot resolve symbol: request."
我对android开发和android studio来说还很陌生,所以很抱歉,这是一个糟糕的问题.
I'm pretty new to android development and android studio so sorry if it's a lousy question.
编辑1
好吧,所以我照着斯科特·巴尔塔(Scott Barta)的话做了,但仍然得到了"cannot resolve symbol: GameRequest."
.
在一个类似的主题上,我发现我应该去项目结构->模块->依赖关系->加号->模块依赖关系,并在那里添加我的库文件.
Ok, so i did what Scott Barta told me, but still got a "cannot resolve symbol: GameRequest."
.
On a simmilar topic i found that i should go to Project Structure -> modules -> dependencies -> plus sign -> module dependency and add my libraries file there as well.
做到了,我明白了:
"Gradle project refrsh failed: Cause: java.lang.StackOverflowError"
我所做的其他事情是去settings.gradle并添加一个
Other things i did was go to settings.gradle and add a
include ":libraries:BaseGameUtils"
在我添加的build.gradle中,在依赖关系树中
In the build.gradle i added, in the dependencies tree
compile project(':libraries:BaseGameUtils')
推荐答案
我只是遇到了同样的问题.对我来说固定的是将google play-services更新到较新的版本.检查您的build.gradle文件,并查看其依赖项中是否正在使用旧版本.如果是这样,请尝试将其替换为
I just ran into the same problem. What fixed it for me was updating the google play-services to a newer version. Check your build.gradle file and see if it's using an older version in the dependencies. If so, try replacing it with
编译'com.google.android.gms:play-services:4.3 +'
compile 'com.google.android.gms:play-services:4.3+'
这篇关于导入游戏.请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!