NoClassDefFoundError while trying to run unit tests on Android Studio

Hello.
I write a test case and run through Android Studio with gradle plugin.
Some of the test cases encountered a problem where some classes could not be found.
I looked at some of the classes and found that Android Studio couldn’t find an external library(ex GoogleAnalytics.java), not a custom class.
I think it’s a matter of dependency.
This is because running the test through command line works well.
And of course in CI.

I’ve been hanging around for a week.
I’d appreciate your help.