Hi All! I have enable proguard in my project. The ...
# android
g
Hi All! I have enable proguard in my project. The app is running great, no crashes and behave like it should. But I when I run the instrumentation tests suddenly I have a lot of weird error, mostly related to kotlin like:
java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/collections/CollectionsKt;
java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/ranges/RangesKt;
And I find myself adding a bunch of rules to my proguard files to make my tests pass when my app is working fine. Any idea what I am doing wrong? Am I missing something?
p
Hi, do you run instrumentation tests for release or debug mode? when running in debug mode, all proguard config should be ignored
g
@pilgr in debug mode at the moment to iterate quickly but I'm planning on turning proguard off afterwards and only have it on our CI tool. Does it make a difference to run them on release or debug?
p
@Galou Minisini I believe proguard shouldn’t be involved by any means in debug builds and so when running instrumentation tests in debug mode. It sounds likely the configuration in build.gradle is wrong. Anyway, it’s hard to tell without a look at build.gradle files