this cause? Let's take a look source code a bit https://android.googlesource.com/platform/tools/base/+/studio-master-dev/build-system/gradle- core/src/main/java/com/android/build/gradle/internal/tasks/PackageForUnitTest.java
Target artifact type to get. In this case, PROCESSED_RES(APK includes only resources) https://android.googlesource.com/platform/tools/base/+/studio-master-dev/build-system/gradle- core/src/main/java/com/android/build/gradle/internal/tasks/PackageForUnitTest.java
you split APK… This should become multiple https://android.googlesource.com/platform/tools/base/+/studio-master-dev/build-system/gradle- core/src/main/java/com/android/build/gradle/internal/tasks/PackageForUnitTest.java
It returns BuildElements that match artifact type. https://android.googlesource.com/platform/tools/base/+/studio-master-dev/build-system/gradle- core/src/main/java/com/android/build/gradle/internal/tasks/PackageForUnitTest.java
Returns the single element contained in iterable. IllegalArgumentException - if the iterable contains multiple elements https://android.googlesource.com/platform/tools/base/+/studio-master-dev/build-system/gradle- core/src/main/java/com/android/build/gradle/internal/tasks/PackageForUnitTest.java
w/Robolectric I found some ways to resolve this • Use Android App Bundle(Recommended) • Android App Bundle allows you to separate the publish settings and build settings.(On publish, bundleXXX. On develop, assembleXXX) • And also reduce your APK size! • Introduce custom Gradle properties and switch it by command line arguments. • It’a not bad idea, but when you run tests on Android Studio, you have to set the arguments every time you want. • Until yesterday, I have been used this. Please choice by yourself
Test w/Robolectric + Binary Resources + Multiple APK does not work correctly. • I recommend to use Android App Bundle • You can fine issue here https://github.com/robolectric/ robolectric/issues/4942