7

I wanted to use a resource folder in my test project with Android Studio to store internationalized strings that I'll only use in my UI tests.

But as I'm able to create the /app/src/androidTest/res folder, I can't create a resource folder such as "values" in it.

Android Studio says that this folder already exists. It exists, but in my main project under /app/src/main/res.

So can I create resources available only for my test project, and how, or I'am completely wrong and the reason that I can't do it is that I mustn't do it ?

Thanks.

Andres Cárdenas
  • 720
  • 1
  • 5
  • 26
Nicolas Massart
  • 530
  • 9
  • 21

2 Answers2

8

As mentioned in this answer, you are probably using the wrong package in the import statement.

import com.your.package.test.R;
Community
  • 1
  • 1
Vedant Agarwala
  • 18,146
  • 4
  • 66
  • 89
0

You can create resources under /app/src/debug/res and use them

jlga
  • 277
  • 2
  • 10
  • 1
    Ok, but this build type is used not only for tests. I don't whant this test resources to be built in the app even in debug build. I whant them only in test app. – Nicolas Massart Sep 10 '15 at 11:29