Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

R cannot be resolved to a variable , syntax errors in program that was working fine day before

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Line 15 and 22 complain that

R cannot be resolved to a variable



I have tried removing the

statement and even renaming it to import com.HelloWorld.firstandroidproject.R;

but the syntax errors still persist ...

any ideas?


Thanks a bunch everyone


 
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should not have to import anything, it should just work - how are you building the project? The R.java (and R.class) files are generated automatically, and part of the package that's listed in AndroidManifest.xml - which in your case should be "com.example.firstandroidproject", not "com.HelloWorld.firstandroidproject".
 
Sam Acropolis
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My package name is as you say it com.example.firstandroidproject;

Im pretty much creating a android virtual device and then attempting to launch it , I have even tried 'cleaning' the project to from the 'project' menu in eclipse.
 
They weren't very bright, but they were very, very big. Ad contrast:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic