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:

Cannot resolve symbol R

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Building my first android game and am getting "cannot resolve symbol R" (lines 31-39) on several java files for instance my EnemyShip class. Using Android Studio ver 2.3.3. I have enemy ship png's in my resources folder so don't really know why I'm getting this error.

 
Marshal
Posts: 4170
555
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
R is a generated class.  You may need to manually import it in to your code.

The R class should be in the top-level package for application.  For example, in my case the top-level package for the application is: com.mcleodnet.hflink, so my code imports: import com.mcleodnet.hflink.R



 
Rancher
Posts: 4936
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The IDE takes care of building the R.java file.  Often an error in an XML file will cause the IDE not to generate the R.java file.  Check all the xml files for errors.
 
Josh Diamond
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Getting errors in my XML files lines 3-9 e.g. cannot resolve symbol @dimen/activity_horizontal_margin



Also getting errors here from lines 3-6 e.g. line 3 cannot resolve symbol @dimen/activity_horizontal_margin
 
Norm Radder
Rancher
Posts: 4936
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

cannot resolve symbol @dimen/activity_horizontal_margin


That value should be defined in the dimens.xml file in the res/values folder.
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic