未能解析:com.android.support.test:测试支持库:0.1

未能解析:com.android.support.test:测试支持库:0.1,android,unit-testing,Android,Unit Testing,我已经按照说明在另一个项目上使用了AndroidJUnitRunner 现在我正试图在另一个项目中使用它,但我遇到了问题 我补充说: testCompile('com.android.support.test:testing-support-lib:0.1') { exclude group: 'junit' // junit:junit-dep conflicts with junit:unit } 发生的情况是Android studio显示错误: 未能解析:com.androi

我已经按照说明在另一个项目上使用了AndroidJUnitRunner

现在我正试图在另一个项目中使用它,但我遇到了问题

我补充说:

testCompile('com.android.support.test:testing-support-lib:0.1') {
    exclude group: 'junit'  // junit:junit-dep conflicts with junit:unit
}
发生的情况是Android studio显示错误:

未能解析:com.android.support.test:测试支持库:0.1

并要求我安装一个新的软件包。我接受并表明:

Loading SDK information...
Refresh Sources:
  Fetched Add-ons List successfully
  Refresh Sources

Installing Archives:
  Preparing to install archives
  Installing Android Support Repository, revision 15
    Installed Android Support Repository, revision 15
  Done. 1 package installed.
但是,当我尝试同步时,我再次收到相同的错误

未能解析:com.android.support.test:测试支持库:0.1

AS要求我再次安装它


我检查了软件包是否已经安装。

复制了您的评论@commonware,以便快速访问


com.android.support.test:testing support lib:0.1
已被
com.android.support.test:rules:0.3


将您的评论复制到commonware,以便快速访问


com.android.support.test:testing support lib:0.1
已被
com.android.support.test:rules:0.3


com.android.support.test:testing-support-lib:0.1
已被
com.android.support.test:rules:0.3
取代。但在另一个项目上,它仍然有效,我担心这与我没有使用apply“plugin:'com.android.application'”有关,正如你从“testCompile”而不是“androidTestCompile”中看到的那样。我现在正在检查“我没有使用apply”插件:“com.android.application”-那么,您需要使用
com.android.application
com.android.library
,否则,尝试使用Android的工具测试是没有意义的。
com.Android.support.test:testing-support-lib:0.1
已被
com.Android.support.test:rules:0.3
取代。但在另一个项目上,它仍然有效,我担心这与我没有使用apply“plugin:'com.android.application'”有关,正如你从“testCompile”而不是“androidTestCompile”中看到的那样。我现在正在检查“我没有使用apply”插件:“com.android.application”-那么,您需要使用
com.android.application
com.android.library
,否则,尝试使用Android的工具测试是没有意义的。
com.Android.support.test:testing-support-lib:0.1
已被
com.Android.support.test:rules:0.3
取代。但在另一个项目上,它仍然有效,我担心这与我没有使用apply“plugin:'com.android.application'”有关,正如你从“testCompile”而不是“androidTestCompile”中看到的那样。我现在正在检查“我没有使用apply”插件:“com.android.application”-那么,您需要使用
com.android.application
com.android.library
,否则尝试使用安卓的仪器测试是没有意义的。