简体   繁体   English

BaseGameUtils无法解析“ com.google.android.gms.games.Games”中的符号android

[英]BaseGameUtils cannot resolve symbol android in: “com.google.android.gms.games.Games”

I'm trying to make an app with G+ and Google play services. 我正在尝试使用G +和Google Play服务制作一个应用。

But I can't from the beginning. 但是我从一开始就不能。

I try to import the project BaseGameUtils, and build the app (sync with Gradle) and run it. 我尝试导入项目BaseGameUtils,并构建应用程序(与Gradle同步)并运行它。

Surprisingly it runs! 令人惊讶的是它运行! and works, but when I go into the code, my imports are not found.(cannot resolve symbol) 并且可以使用,但是当我进入代码时,找不到我的导入。(无法解析符号)

This leads me to think that my Gradle is well configured but I am missing something (library, dependency, module) in the app, because Android Studio complains about it. 这使我认为我的Gradle配置正确,但是我在应用程序中缺少某些东西(库,依赖项,模块),因为Android Studio抱怨它。

I have the latest Android Studio 0.8.9, and my SDK is updated with all the needed installs. 我拥有最新的Android Studio 0.8.9,并且我的SDK已更新为所有需要的安装。

Can someone put a "how to" import the BaseGameUtils project/library step by step for latest Android Studio and what else is needed? 有人可以为最新的Android Studio逐步介绍“如何”导入BaseGameUtils项目/库吗,还需要什么?

Also, my Gradle is configured so the app builds with app support v4, but as before, it cannot be resolved. 另外,我的Gradle已配置为可以使用应用支持v4来构建应用,但与以前一样,无法解决。 How do I add it? 如何添加? I already have it in Project Structure > Modules > app > Dependencies > support-v4 as library dependency. 我已经在项目结构>模块>应用>依赖关系> support-v4中将其作为库依赖关系。

I had the same problem. 我有同样的问题。 Solved it almost. 差不多解决了。 It's very important to put your to the latest version (build.gradle --> compileSdkVersion 21). 升级到最新版本(build.gradle-> compileSdkVersion 21)非常重要。 The same with the dependencies ( compile project(':libraries:BaseGameUtils'), compile 'com.android.support:appcompat-v7:21.0.+' compile 'com.android.support:support-v4:21.0.+' and the latest version of Google PLay Services compile 'com.google.android.gms:play-services:+'. Of course you should update your SDK files first (install API21+Tools) 与依赖项相同(编译项目(':libraries:BaseGameUtils'),编译'com.android.support:appcompat-v7:21.0.+'编译'com.android.support:support-v4:21.0.+'和最新版本的Google PLay Services会编译为“ com.google.android.gms:play-services:+”。当然,您应该先更新SDK文件(安装API21 + Tools)

I had the same problem. 我有同样的问题。 It's a bug when importing a project with BaseGameUtils dependency from eclipse to Android Studio. 将具有BaseGameUtils依赖项的项目从eclipse导入到Android Studio时,这是一个错误。 This can be solved by commenting out this import as it is no longer required: 可以通过注释掉此导入来解决此问题,因为它不再需要:

//import com.google.android.gms.drive.internal.r; // import com.google.android.gms.drive.internal.r;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM