【发布时间】:2022-06-22 22:45:10
【问题描述】:
android 项目目录
my-app/
├─ app/
│ ├─ test/ <- test here
│ ├─ main/
│ ├─ androidTest/ <- test here
├─ common_res/
│ ├─ main/
│ ├─ res/
│ ├─ values/ <- reference resources
… other resources
…
在 IDE(在 Android-Studio 中),无法引用字符串或可绘制资源等资源。 它显示红色标志
(但单元或 UI 测试效果很好)
我尝试如下但失败了
(app/build.gradle)
dependencies {
...
implementation project(":common_res")
testImplementation project(":common_res")
androidTestImplementation project(":common_res")
}
并尝试了 sourceSet(in app/build.gradle) 的方式,但我没有实现我的目标。
(我对gradle sourceSet不太了解)
截图
如何解决这个问题?
【问题讨论】:
标签: android android-studio gradle intellij-idea android-testing