Whenever I enable includeAndroidResource in my build.gradle file, manifest files can't be found on release or any non-debug buildtypes(It's ok with debug build).
Add includeAndroidResources to the app module:
```
android {
...
testOptions {
unitTests {
includeAndroidResources = true
}
}
...
Create a new test class and add a custom manfiest with `@Config` annotation
@RunWith(RobolectricTestRunner::class)
@Config(manifest = "src/main/AndroidManifest.xml")
class MyTest {
}
Run `test[Buildtype]UnitTest` gradle task(e.g. `testBetaUnitTest` or `testReleaseUnitTest`).
The below exception will be thrown:
Caused by:
java.lang.IllegalArgumentException: couldn't find 'src/main/AndroidManifest.xml'
```
It can be solved by changing src/main/AndroidManifest.xml to AndroidManifest.xml, but I don't know why src/main/AndroidManifest.xml works in debug mode.
You shouldn't need to specify a manifest in your @Config() anymore. Gradle passes the location of the merged manifest.
Also, try adding
android {
enableUnitTestBinaryResources=true
}
which should switch you over to binary resource mode, test startup time should be a lot faster and resource handling is a lot more faithful to real Android.
If I want some other manifest for test ?
Most helpful comment
If I want some other manifest for test ?