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 trialCindy Michalowski
9,405 PointsSolution to: Exception in thread "main" java.lang.annotation.AnnotationFormatError: Invalid default: public abstract jav
After following the steps shown in this video, my test failed. The log showed the following error: Exception in thread "main" java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.robolectric.annotation.Config.application()
In order to fix this error, I took two steps: 1) I deleted the .gradle folder from my project, and then rebuilt the project 2) As mentioned by another student in this section, I went to Run -> Edit Configurations -> MainActivityTest -> Working directory and entered the following value: $MODULE_DIR$
I'm not exactly sure why the first step was necessary, but it solved my problem.
1 Answer
Christopher Stewart
7,531 PointsThis worked for me! Thanks
Cindy Michalowski
9,405 PointsNo problem! Glad it helped! :)
Reza Arbabian
8,987 PointsReza Arbabian
8,987 PointsFirst solution was solved my problem too