1

I have been working on a project in Android studio. My teammates need to run it in Eclipse. As there is no manual way to migrate back to Eclipse from Android studio, I followed these instructions: How to import Android Studio project in Eclipse?

I now just get "R cannot be resolved as a variable" errors. Any ideas why? I made a new Eclipse Android project and I copied the java classes, manifest, and res folder. I then refactored the project name to make sure it was correct.

Any ideas?

Community
  • 1
  • 1
Cammers
  • 11
  • 7
  • Check xml files for any error. – Green goblin Mar 18 '14 at 14:33
  • Check for any error in xml files - ALL xml files, not only layouts. Check for upper case letters (or other **invalid characters**) in resources file names. Perform a Project/Clean after setting Build Automatically, in Eclipse. – Phantômaxx Mar 18 '14 at 14:34
  • Hi. I will check the files, but why would I have an error in the xml files if the code worked fine in Android studio? Any line that has R.xxx gives me this error, regardless of the many different xml files in the project. – Cammers Mar 18 '14 at 14:38
  • possible duplicate of [R cannot be resolved - Android error](http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error) – Mouhamed Ndiaye Mar 18 '14 at 14:38
  • Still hanging here. Thanks for the advice, but I can't find any problem. Probably going to redo my work in eclipse. Yay for giving up. – Cammers Mar 18 '14 at 19:45

2 Answers2

0

Please make sure,there is no error in XML files,including Manifest. If there is any error in XML files,R.java will not be generated.

If so, make sure R.java is imported properly.

In imports,remove

import android.R.java;

and import your application's R.java.

Mohammed Imran N
  • 1,279
  • 1
  • 11
  • 26
0

Your project ADT build fails, check steps 2.4, 2.5

detailed answer is on How to import Android Studio project in Eclipse?

IMPORTING FROM ANDROID STUDIO INTO ECLIPSE

http://www.nodeclipse.org/projects/gradle/#Importing-from-Android-Studio-into-Eclipse describes steps needed


(source: nodeclipse.org)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Paul Verest
  • 60,022
  • 51
  • 208
  • 332