These are the test dependencies:
// tests
androidTestCompile 'org.mockito:mockito-all:1.10.8'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.3.1'
androidTestCompile 'junit:junit:4.12'
androidTestCompile ('org.robolectric:robolectric:2.4') {
exclude module: 'commons-logging'
exclude module: 'httpclient'
}
And my debug
build types has minifyEnabled true
so as I don't hit a DEX method limit. The complete building is defined as following:
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 15
targetSdkVersion 22
versionName VERSION_NAME
proguardFile getDefaultProguardFile('proguard-android.txt')
proguardFile 'proguard-rules.pro'
}
signingConfigs {
debug {
storeFile file('keystore/debug.keystore')
}
}
productFlavors {
develop {
versionCode versionBuild()
signingConfig signingConfigs.debug
proguardFile 'proguard-rules-debug.pro'
}
}
buildTypes {
debug {
minifyEnabled true
}
}
There is a default proguard-rules.pro
file and a additional proguard-rules-debug.pro
for the flavor.
The :proguardDevelopDebug
gradle task passes successfully based on the options I have. However the :proguardDevelopDebugAndroidTest
fails with the following errors: http://pastebin.com/S623UGfP
Which is strange since I have added the following on the file:
-dontobfuscate
# ------------------- TEST DEPENDENCIES -------------------
-dontwarn org.hamcrest.**
-dontwarn com.squareup.**
-dontwarn com.google.android.**
-keep class com.google.android.** {
*;
}
-keep class com.google.common.** {
*;
}
-keep class org.hamcrest.** {
*;
}
# Apache Maven
-keep class org.apache.maven.** { *; }
-dontwarn org.apache.maven.**
# Junit
-keep class org.junit.** { *; }
-dontwarn org.junit.**
# Mockito
-keep class org.mockito.** { *; }
-dontwarn org.mockito.**
# Robolectric
-keep class org.robolectric.** { *; }
-dontwarn org.robolectric.**
Any ideas why those two don't work together?