I've come across a strange problem after enabling Proguard on my testing
APK. Proguard is enabled on both the testing and tested apps. I'm using
Android Studio 1.2.11 and Gradle 1.2.3.
Here is my build.gradle:
buildTypes {
// Development configuration.
debug {
debuggable true
jniDebuggable true
signingConfig signingConfigs.debug
// Configure ProGuard
minifyEnabled true
// Default configuration
proguardFile 'proguard/proguard.cfg'
// Add all of our component-specific configurations (excluding the
Android generic, as we want it to be last)
FileTree tree = fileTree(dir: 'proguard', include: '*.txt', exclude:
'Android.txt')
tree.each {File file ->
proguardFile file.getCanonicalPath()
}
// Android fallbacks
proguardFile 'proguard/Android.txt'
// Debug configuration
proguardFile 'proguard/proguard-debug.cfg'
// Test configuration
testProguardFile 'proguard/proguard-test.cfg'
}}
The build of both the testing and tested app APKs work fine. But when the
testing APK is installed and runs, I get "No tests were found". I've
verified that if I run the test on a non-Proguard buildType, the tests run
fine.
Additionally, I've examined seeds.txt and dump.txt from the Proguard
output, and have verified that the testing code is indeed present in the
testing APK.
Furthermore, there is no usage.txt (the file that lists code stripped from
the APK) which implies that my test code was not removed by Proguard. There
is also no mapping.txt file because I set -dontobfuscate in
proguard-test.cfg.
Can anyone see what I'm doing wrong here?
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.