sun2son
Lost but trying
Profile
Posts: 6
Reg: May 17, 2012
location unknow...
6,310
09/14/12 09:09 AM (13 years ago)

Eclipse error: R Cannot be resolved to a variable

I believe this is JAVA related. I see solutions elsewhere advising going into src> my project > main.java and then checking the code within there. Problem is I don't see any 'main.java' folder in BT source code. I believe the problem started when I saved a couple of images in using a underscore (_) or a space in the file name. Images are in the res>drawable>drawable-hdpi folder. In my 'Problems' screen under 'Path' it refers to '...BT_activity_root_src...' I went from a running app to 413 errors with that mistake. Suggestions &/or fixes? tia, John
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
09/14/12 09:24 AM (13 years ago)
Have you removed underscores/spaces from image names? If so, save project and try a Project > Clean
 
sun2son
Lost but trying
Profile
Posts: 6
Reg: May 17, 2012
location unknow...
6,310
like
09/14/12 11:20 AM (13 years ago)
raveyd, That worked - and was SO simple! I also noticed I had used a Capitol letter in another pic - another no-no. I'm back in business. THX!
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
09/14/12 01:19 PM (13 years ago)
hehe! not much is simple in eclipse! It's some tough software to get playing nicely. Glad it worked.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
09/14/12 08:30 PM (13 years ago)
You get that error also if your project API isn't set to Google 2.2.
 
sun2son
Lost but trying
Profile
Posts: 6
Reg: May 17, 2012
location unknow...
6,310
like
09/17/12 06:33 AM (13 years ago)
Hi Susan, I've had my share of Google API 2.2 issues - but I don't think that was the case here (but as a 'almost born yesterday rookie' I could be wrong). Thx for the feedback - I'll keep in my list of errors & fixes. John
 
amnamn
I hate code!
Profile
Posts: 3
Reg: Feb 14, 2012
Provo, UT
1,980
like
12/19/12 02:31 PM (13 years ago)
I know this is an old thread, but I spent several hours trying to figure this one out, so hopefully someone will benefit from this answer. For me (I'm on Windows 7 by the way), I went into the Android SDK manager (If your in Eclipse you go to Windows/Android SDK Manager)and installed the "Android SDK Platform-tools." I'm brand new at this (just started yesterday) so I don't know why this fixed my problem, but it did. Hope this helps. -Ammon
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/19/12 02:40 PM (13 years ago)
Android SDK platform-tools an absolute necessity, strange it didn't get installed when you installed the sdk? Make sure everything in the sdk manager is up to date, it's a fast moving environment. I'm updating as we speak, it's been going for over an hour, yet it was fully up to date just a few weeks ago.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.