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 (2014) Getting Started with Android Running the Fun Facts Project

I get this error when building app Error:(7, 17) Resource id cannot be an empty string (at 'id' with value '@+id/')

Cant run the app because i get this error when I try

1 Answer

Pablo Rocha
Pablo Rocha
10,142 Points

Looks like one of your layout xml files you did not define a resource correctly. Here is an example, notice how the id is prefixed with "@+id/" then the name of the resource.

Let me know if this does not help. We may need to see the logcat dump to get a better understanding of where the error is occuring.

    <TextView
        android:id="@+id/textView"
        android:text="@string/did_you_know"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="24sp"
        android:textColor="#80ffffff" />