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) Creating the Screen Layout Setting Padding

My padding isn't being correctly applied. Also, my Did You Know? id doesn't appear to be working correctly either!

Hello friends,

I just completed the Setting Padding video, and attempted to set the padding on my Fun Facts assignment app. The padding didn't appear to work in the app previewer, and when I attempted to run the app, I got the following error message: Error:(17, 21) Resource id cannot be an empty string (at 'id' with value '@didyouknow/').

Thanks in advance for your help!

Not sure but since the id cannot be empty string, maybe something is wrong with your string and the label with ur padding and when you try to apply it?

Kate Hoferkamp
Kate Hoferkamp
5,205 Points

The error you are getting says that the string didyouknow is empty, which it cannot be. There must be a value in there. Can you show your strings.xml?

5 Answers

Kate Hoferkamp
Kate Hoferkamp
5,205 Points

Okay, one of your first problems, I believe, it that you are referencing didyouknow, instead of didYouKnow which is what you used in strings.xml. Can you check that first?

It sounds like I've got two separate problems here. Here's the strings.xml

<?xml version="1.0" encoding="utf-8"?> <resources>

<string name="app_name">Fun Facts</string>
<string name="didYouKnow">Did you know?</string>
<string name="action_settings">Settings</string>

</resources>

And here is dimens.xml

<resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">50dp</dimen> <dimen name="activity_vertical_margin">50dp</dimen> </resources>

I think everything sorted itself out, looks like Android Studio just wanted a reboot and a chance to be introspective. It got that out of its system and is working fine now.

Thanks for the help!

Kate Hoferkamp
Kate Hoferkamp
5,205 Points

Yay! Glad you got it working.

My Padding isn't working even though I have all the right code in the padding area. I also have a problem where the app doesn't appear in my emulator and gives me this error: pkg: /data/local/tmp/Felix_Developing.funfacts Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

Reboot fixed it!