Android的工作室不服,谷歌库安装 [英] Android Studio refuses to accept that Google Repository is installed

查看:313
本文介绍了Android的工作室不服,谷歌库安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得AdMob的运行。但是,对于一些奇怪的原因,我不能让Android的工作室接受了谷歌信息库已安装。
事情是,它被安装在SDK管理器。现在重新安装多次。项目结构SDK路径是一样的Andr​​oid SDK管理器。

I am trying to get AdMob running. But for some strange reason, I can not get Android Studio to accept that the Google Repository is installed. Thing is, it is installed in the SDK manager. And reinstalled multiple times now. Project Structure SDK path is the same as in Android SDK Manager.

当我将鼠标放在编译com.google.android.gms:播放服务:6 +'在我的build.gradle 行,我得到这个提示

When I mouse over the compile 'com.google.android.gms:play-services:6.+' line in my build.gradle, I get this tooltip:

"Dependency on Play Services, but the SDK installation does not have the "Extras > Google Repository" installed. Open the SDK manager and install it"

当我尝试编译,这个错误:

When I try to compile, this error:

Error:Failed to resolve: com.google.android.gms:play-services:6.+

使用该错误来一个链接到安装存储库,我现在多次使用。 Android的工作室并不关心。帮助。

With that error comes a link to install the Repository, which I used multiple times now. Android Studio does not care. Help.

编辑:当我使用一个新的空项目,它的工作原理,以及Android工作室找到库。不知道是怎么回事的。

edit: When I use a fresh empty project, it works, and Android Studio finds the Repository. No clue what is going on here.

推荐答案

我同样的问题苦难终于找到了一个简单的解决方案(我使用 Android的工作室 1.5.1在MacOS):

I was suffering with the same problem and finally found a simple solution (I'm using Android Studio 1.5.1 on MacOS):


  1. 文件的 - > 项目结构

  2. 在打开的窗口中的左侧,下的开发者服务的,选择的广告

  3. 选中复选框的 AdMod 的旁边。您的窗口应该是这样的:

  1. Go to File --> Project Structure
  2. On the left hand of the opened window, under Developer Services, select Ads
  3. Check the checkbox next to AdMod. Your window should look like this:

点击的确定

这将添加所需的依赖于Android的的build.gradle ,并同步摇篮。

This will add the required dependency to the Android's build.gradle, and sync Gradle.

在同步完成,而只是为了确保,清理并重建项目:

When the sync is done, and just to make sure, clean and rebuild your project:


  1. 构建的 - > 清理项目

  2. 构建的 - > 重建项目

  1. Build --> Clean Project
  2. Build --> Rebuild Project

这就是它!我希望这有助于。

That's it! I hope this helps.

这篇关于Android的工作室不服,谷歌库安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆