Android test module classloader obfuscation

129 Views Asked by At

I'm testing my :app module with a specific :test module.

The test module applies the com.android.test plugin and configures release to test the obfuscated release variant.

Now both modules use kotlin.Result and obfuscate it with the same name. The difference only is, that :test uses kotlin.Result$Companion while this type is completely striped from the :app APK.

The problem is, that the test code resolves the obfuscated class from the app dex file instead of looking it up in the test dex file, therefore the companion object is not found.

How do I make sure to load the correct classes in my test cases?

0

There are 0 best solutions below