为什么库模块android.support.test不添加依赖关系可见 [英] Why is library module android.support.test not visible in add dependency

查看:5068
本文介绍了为什么库模块android.support.test不添加依赖关系可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加居preSSO我在Android的Studio项目。我已经安装了支持库,事实上已经用它的一部分。然后我说这些依赖于应用程序/ build.gradle 按照安装说明:

I am adding Espresso to my project in Android Studio. I have installed the Support Repository and in fact have already been using pieces of it. Then I added these dependencies to app/build.gradle per the install instructions:

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'

在写我的测试中,自动完成识别文物的存在。但是,当我跑我得到这个错误:

in writing my test, auto complete recognizes the existence of the artifacts. But when I run I get this error:

error: package android.support.test does not exist
error: package org.junit does not exist

和其他一些子包这两个。

and a number of other subpackages to these two.

所以我删除了从build.gradle两个以上的线路,并试图再添加在GUI项目结构/模块/依赖

So I removed the two above lines from build.gradle and attempted to add then in the GUI project structure/modules/dependencies

既不是'com.android.support.test.es preSSO:ES preSSO核心:2.0'也不是'com.android.support.test:测试支持-lib目录下:0.1显示为选项可供选择。然而,在我的文件系统有<$c$c><sdk>\extras\android\m2repository\com\android\support\test\es$p$psso\es$p$psso-core\2.0\与文件的全套包括 ES preSSO核-2.0.aar 这我能够通过的WinZip打开并浏览其内。在文件系统中,它看起来比通过SDK管理器支持库中安装了其他图书馆没有什么不同。

neither 'com.android.support.test.espresso:espresso-core:2.0' nor 'com.android.support.test:testing-support-lib:0.1' appear as options to choose from. However, in my file system there is <sdk>\extras\android\m2repository\com\android\support\test\espresso\espresso-core\2.0\ with the full complement of files including espresso-core-2.0.aar which I am able to open and navigate within it via winzip. In the file system it looks no different than the other libraries installed via SDK Manager with Support Repository.

为什么不机器人工作室承认这个库?

Why doesn't android studio recognize this library?

您的帮助是很大的AP preciated,没有其他人,我可以找到,似乎遇到了这个问题。这是最接近我可以找到:<一href="http://stackoverflow.com/questions/28796114/why-do-packages-from-library-module-does-not-exist-upon-compilation-even-when-a">Why不要从库模块封装不编译时存在,即使在机器人工作室表示code没有错误?

Your help is greatly appreciated, no one else that I can find seems to have run into this problem. This is the closest I could find: Why do packages from library module does not exist upon compilation, even when Android Studio shows no errors in code?

我试图重新安装支持库的两倍。

I have tried reinstalling Support Repository twice.

推荐答案

我有同样的问题,这是解决通过点击清理项目从Android的Studio中Build选项卡。

I've had the same problem and it was solved by hitting Clean Project from the Build tab in Android Studio.

在击球清理项目,看摇篮控制台潜在的错误,如果它成功地完成了清洗,简单地进入你的测试类中的任何一个,并键入ES preSSO和智能code完成应提供建议。当您使用居preSSO之后,一切都应该自动导入。

After hitting Clean Project, watch the Gradle Console for potential errors and if it completes the cleaning successfully, simply go into any one of your test classes and type in "Espresso" and the smart code completion should offer suggestions. Everything should automatically import as you use Espresso after that.

希望这有助于!

这篇关于为什么库模块android.support.test不添加依赖关系可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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