Reputation: 11
No such manifest file: build/intermediates/bundles/debug/app/src/main/AndroidManifest.xml
Refered to -Robolectric says "AndroidManifest.xml not found"
https://github.com/robolectric/robolectric/issues/1648 but was not helpful.
Upvotes: 1
Views: 119
Reputation: 1
You can fix the No such manifest file: ./AndroidManifest.xml warning, by updating your gradle file.
Add the following line to your gradle file to so that the correct Android manifest is used. The includeAndroidResources option allows you to access android resources in your unit tests, including your AndroidManifest file. app/build.gradle
testOptions.unitTests {
includeAndroidResources = true
}
Upvotes: 0
Reputation: 3658
Check your gradle and your class :
Gradle :
testCompile 'org.robolectric:robolectric:3.3'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
In your test Class :
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 25)
public class YourTest {
@Test
public void shouldNotBeNull() throws Exception {
//put your test here for example
}
)
YourTest class should be put in Test folder (not AndroidTest folder)
On Android Studio :
Upvotes: 1