问题描述:

Hi I am trying to learn how to write an android app in Eclipse Juno with the latest Android SDK and tools all for 64bit windows 7, in case that makes any difference.

I had previously got through the tutorials at https://developer.android.com/training/basics/firstapp/starting-activity.html#ReceiveIntent

All was working fine until i got to the lesson 'Setting up the Action Bar' where it asked whether the app should support Android 3.0 and above only or 2.1 and above. I chose 2.1 and above and followed those instructions to include the support libraries for compatibility. After I did that and set up the java build path, I am now getting many errors in the basic app that state 'R cannot be resolved to a variable'.

I have searched quite extensively and tried many previous solutions but no luck. I am thinking there may be a conflict as I have my previous app (before adding the action bar) also in the package in eclipse. Should I remove it and try to rebuild with just the new one, and the compatibility folders?

Any new ideas that I can try are welcome. I can post any code that might help - it is just basic tutorial stuff.

Cheers,

LRW

网友答案:

See if you have imported: android.R if yes, delete that import :)

相关阅读:
Top