Android Studio 3.0 Beta2
classpath \'com.android.tools.build:gradle:3.0.0-beta3\'
testCompile \'org.robolectric:robolectric:3.4.2\'
Test class that
As mentioned by an engineer from Google team (most possibly Xavier Ducrohet), Robolectric has issues with AAPT2:
Robolectric is not compatible with aapt2.
Two options here.
First option - follow Robolectric guidelines for Android Studio 3.0+
Add the following to your build.gradle:
android {
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
Annotate your test with the Robolectric test runner:
@RunWith(RobolectricTestRunner.class)
public class SandwichTest {
}
Second option: disable AAPT2 adding following line into gradle.properties
file:
android.enableAapt2=false