Robolectric – Package targetSdkVersion=30 > maxSdkVersion=29

Found this post with the same issue, with a different error message.
This answer helped me to solve the issue.

Posting the same here.

Create a robolectric.properties file inside the app/src/test/resources directory with the following line:

sdk=29  

This will force Robolectric to use API 29 instead of 30.

Note: Robolectric supports up to SDK 29 now (As on Sep 4th, 2020).

Leave a Comment