Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Testing in Android Unit Testing - Now Featuring Robolectric! Introducing Robolectric

Clemens Kozmich
Clemens Kozmich
253 Points

What SDK Versions + Roboelectric version can I use to have a functioning gradle file?

I have issues with my app/build.gradle file as roboelectric version 3.1 and sdkVersion 23 are outdated and do not seem to work with latest Android Studio.

Can somebody add an update to show which versions should be used in 2019?

Thanks.

i am facing same issues of gradle build

1 Answer

Hi Clemens. Your compileSdkVersion should be the newest stable version available, so 28 as of Feb 2019.

With Android Studio 3.3.1, you should have:

  • Android Gradle plugin 3.3.1
  • Gradle 4.10.1

(Android Studio should offer you to update it all once you modify your compileSdkVersion)

As for Robolectrics, their setup guide tells us that the current version is 4.2.

Hope that helps :)

Clemens Kozmich
Clemens Kozmich
253 Points

Thanks Lauren, I hope this info will be added to the course material so that everybody is already aware of this when doing this course ;-)

You're welcome Clemens :)