Hi. I’ve just updated app to Kotlin 1.6.0. Everyth...
# android
d
Hi. I’ve just updated app to Kotlin 1.6.0. Everything works except of Espresso tests:
Copy code
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.compose.ui.platform.InfiniteAnimationPolicy$DefaultImpls" on path: DexPathList[[zip file "/system/framework/android.test.mock.jar", zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.xxx.test--U04pIcan0sKvbMH_f3aCQ==/base.apk", zip file "/data/app/com.xxx-MvGPQxMJ3GAEvifVyCdW8w==/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.test--U04pIcan0sKvbMH_f3aCQ==/lib/x86, /data/app/com.esky-MvGPQxMJ3GAEvifVyCdW8w==/lib/x86, /data/app/com.xxx.test--U04pIcan0sKvbMH_f3aCQ==/base.apk!/lib/x86, /data/app/com.xxx-MvGPQxMJ3GAEvifVyCdW8w==/base.apk!/lib/x86, /system/lib]]
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
	... 39 more
I’m using latest versions of compose libs:
1.1.0-beta04
Any ideas?
Just for release build type.
a
Can you show me your build.gradle file, please.
d
I’ve found it’s stricte connected with R8. Espresso tests with minifyEnabled won’t work.
i
Espresso tests won't work by default on minified builds because the test apk needs to know the names of the app apk. For that you would need to add to the proguard file all classes needed by the espresso tests so that they don't get minified. Alternatively, smart people at slack created a gradle plugin https://slackhq.github.io/keeper/ which does that automagically and is working quite nicely for me