-4

I was working in a Android project and I imported it to another laptop to continue my work, but then I got this error in the project:

Description : R cannot be resolved to a variable
Resource : AccueilFragment.java
Path : /AppV1/src/com/example/appv1 
Type : Java Problem

The folder gen(Generated Java Files) contain just the package com.example.appv1--->BuildConfig.java and there is not the file R.java

CKing
  • 14,153
  • 4
  • 39
  • 77
Ali
  • 75
  • 3
  • 8
  • 1
    Clean and build your project – Deepika Rajani Apr 30 '15 at 09:57
  • Here are some detailed answers to this error: http://stackoverflow.com/questions/2757107/developing-for-android-in-eclipse-r-java-not-generating http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error – ihsan Apr 30 '15 at 09:58
  • Clean and Re-Build your Project. If it still generates no R, you may have some Errors. Errors could be in every Folder (style, values, etc.) – B. Kemmer Apr 30 '15 at 09:59

2 Answers2

1

I was facing the same problem Try this:

Go to Properties->Java Build Path, Now Select "Order and Export" Tab, Unchecked the JAR file (like v4 or v7) and then clean the project

I think this can help you.

Rakshit Nawani
  • 2,490
  • 12
  • 25
0
  1. Check drawable folders may have png images with not valid names or resources
  2. Clean the project select project->Menu->project->clean selected project
  3. Create a new workspace and add the backup copy of your project at newly one
vefthym
  • 7,108
  • 5
  • 26
  • 55
AmDroid
  • 131
  • 5