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 Build a Simple Android App with Java Creating the Screen Layout Setting a Fullscreen Theme

Failed linking file resources when changing factTextView size to 24sp

When I change "factTextView" size to 24sp, IDE goes kinda crazy and changes size of text on the preview to 60sp+ and the whole project does not build. Builder shows:

"Java failed linking file resources"

XML code is: <TextView android:id="@+id/factTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="false" android:layout_centerInParent="true" android:scrollbarTrackHorizontal="back" android:text="Ants stretch when they wake up in the morning " android:textColor="@android:color/white" android:textSize="24sp" />

It looks like IDE has problem with text wrapping on the screen. Any idea what am I doing wrong?

1 Answer

Hi Marta

My guess is the error is here:


According to the documentation, you're supposed to give a reference to a resource. I'm not quite sure what back is for here. May I ask why you're using this attribute here?

Btw, to post formatted code, just surround it with 3 backticks (`), no parenthesis, and write java next to the top ones:


your code


without the parenthesis

Hope that helps :)