0

I know this may sound like a duplicate, but I have read and tried avery answer posted here. It is just not working for me.

What do I need to do to fix this?

only android.R is working , I can't use R directly. I have been hunting the solution for few days. I didn't really wanted to go back to eclipse but I wasted a lot of time already trying to resolve this.

any idea?

Things I tried:

and more....

Community
  • 1
  • 1

2 Answers2

1

Things to do: Be sure you delete any stray imports lines that are pulling in android.R or any other package.R, then re-ruild/clean restart eclipse/android studio.

mbiokyle
  • 152
  • 9
  • please elaborate more on which file do I need to check, I have no idea where to find these –  Apr 14 '14 at 17:05
  • All of your Activity files (Any thing that extends Activity). The import statements will be at the top of the files. – mbiokyle Apr 14 '14 at 17:06
  • I tried that, error remains. I know this was the way to fix it in eclipse –  Apr 14 '14 at 17:14
  • `Android Studio` as indicated in my title –  Apr 14 '14 at 17:15
  • Sorry, have you tried deleting all of the build files (in the build/ dir) And then rebuilding? Also be sure to check that you have no syntax errors in your xml files and Android Manifest. – mbiokyle Apr 14 '14 at 17:18
  • Glad I could help! Sorry it took a million comments – mbiokyle Apr 14 '14 at 17:24
0

I had the same issue when I tried importing an existing Eclipse Android Project into Android Studio. The issue was resolved when I removed the following code in the build.gragle file :

here is the code

`dependencies {
        classpath 'com.android.tools.build:gradle:0.4+

}`
Raja Simon
  • 10,126
  • 5
  • 43
  • 74
Samar
  • 351
  • 1
  • 3
  • 8