String resources not found

2,092 views
Skip to first unread message

Ryan Bis

unread,
Dec 2, 2011, 3:16:25 PM12/2/11
to adt...@googlegroups.com
This may not be best suited here, but I'm not sure where else to post this.

I've written a plugin based off ADT 15.0.0, which essentially just modifies the new project wizard (it copies over some other files, and adds a library to the build path).

I upgraded to ADT 15.0.1. The only thing I found to work not quite right is that in the /res/layout/main.xml, it can't find the string resources. The strings.xml is in the /res/values folder, and everything looks right. I created a new project with the default ADT wizard, and nothing looks any different. Yet, within the newly created project with my plugin, it can't find the strings resource.

Interestingly enough, I can access the string resources just fine through java. So for whatever reason, the main.xml file can't see the string resources. Any clue why this is happening?

Thanks,
Ryan Bis

Xavier Ducrohet

unread,
Dec 2, 2011, 4:40:14 PM12/2/11
to adt...@googlegroups.com
15.0.1 didn't change any of that over 15. It's mostly fixes for the
build system.

When you say "it can't find the string", what exactly are you talking
about? The layout editor? when the app is running on a device?

--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Ryan Bis

unread,
Dec 2, 2011, 4:51:17 PM12/2/11
to adt...@googlegroups.com
Sorry, the graphical layout editor. It says "Couldn't resolve resource @string/app_name", and "Couldn't resolve resource @string/hello". What's strange is that the app_name string isn't anywhere in main.xml.

It's not a big deal, as the string resources can be accessed through code, but it's strange that the graphical editor can't find them.

Xavier Ducrohet

unread,
Dec 2, 2011, 4:56:13 PM12/2/11
to adt...@googlegroups.com
the app_name is because it's defined as the application name in the
manifest and that's the text we display in the fake action bar in the
editor.

It's a bit strange indeed that it would not find it.

--

Ryan Bis

unread,
Dec 2, 2011, 5:00:39 PM12/2/11
to adt...@googlegroups.com
Also, if I try to edit the text of the default TextView that's there, it doesn't show anything under Project resources. If I hit New String, the New R.string drop down box shows both app_name, and hello. Go figure.

Ryan Bis

unread,
Dec 4, 2011, 12:34:26 AM12/4/11
to adt...@googlegroups.com
Ok, I just tried creating another project, and everything's fine. The only thing I can think of is that I originally had created a project which had a name I had used in the past (even though the folder no longer existed).

B Lyon

unread,
Dec 2, 2011, 5:36:28 PM12/2/11
to adt...@googlegroups.com
I've seen the same thing about layout editor complaining about missing
strings that are definitely there... 15.0.0.

I am kind of assuming a bunch of layout editor issues will be resolved
soon... like the include one, for example.

Xavier Ducrohet

unread,
Dec 6, 2011, 1:59:14 PM12/6/11
to adt...@googlegroups.com
This is very strange. I've been trying but I just can't reproduce the
include problem.

--

B Lyon

unread,
Dec 7, 2011, 3:42:10 AM12/7/11
to adt...@googlegroups.com
For the string issue, I just noticed that after I double clicked on
the xml file with the string definitions, it seemed to do some kind of
recalc/refresh, and then the missing string issue seemed to be gone
for the moment. Still problems with the layout includes and drawables
("<item> tag requires..."). Windows 7 64-bit
Reply all
Reply to author
Forward
0 new messages