-
Notifications
You must be signed in to change notification settings - Fork 32
Running tests: workaround already added error
tleyden edited this page Oct 16, 2014
·
1 revision
If you:
- Run a single test via the Android Studio UI
- Run
./gradlew connectedInstrumentTest
or./gradlew :CBLiteListener:connectedInstrumentTest
on the command line
You will run into the error:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: LAcme/Serve/CgiServlet;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
.....
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Ljavax/servlet/Filter;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
.........
2 errors; aborting
at com.android.ide.common.internal.CommandLineRunner.runCmdLine(CommandLineRunner.java:98)
at com.android.ide.common.internal.CommandLineRunner.runCmdLine(CommandLineRunner.java:69)
...
Issue 59592 in Android Studio.
This will only work if you are running the tests via the command line
./gradlew :CBLite:connectedInstrumentTest
This is the best option if you are running the test via the Android Studio UI
Make the following two changes:
- Go to the couchbase-lite-android/CouchbaseLiteProject directory
- Edit settings.gradle to remove ':CBLiteListener' from the list
- Edit CouchbaseLiteProject/dependencies-test.gradle to remove the line with
compile project(':CBLiteListener')