I was trying Kotlin Gradle Script and Android Testing.
When I try to configure android resource for Testing I get the following error :
Cannot access includeAndroidResource It is private in UnitTestOptions.
What is the proper way to enable using android Resource in Android Unit testing?
After posting this question, I went back to Android Studio and tried to see what's there for autocomplete. I pressed Control+Space
just after testOptions.unitTests.
and boom, there was the option called isIncludeAndroidResources
which was kotlin getter in TestOptions class for
private includeAndroidResource
which I then set to true
.
Solution :
testOptions.unitTests.isIncludeAndroidResources = true
Lesson: Try to write a question to explain the problem, sometimes answer is inside your own head.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With