Import .R Cannot Be Resolved When I Import Actionbarsherlock

import .R cannot be resolved when I import actionbarsherlock

edited the build path of my android project to include the library

Never manually modify the build path of an Android project.

ActionBarSherlock is an Android library project. You need to add a reference to ActionBarSherlock's library project from your main application project and undo the manual change to the build path.


UPDATE

The second half of your problem was that your build target was set too low. The build target controls what version of the Android classes, resources, etc. is available to your app, and if you use ActionBarSherlock, you need this to be API Level 14 or higher.

if I make my project build target 4.0, can I still run it on an emulator/phone running Android 2.3?

Yes. Set your android:minSdkVersion to be 10 or lower. Eclipse (via Lint) will yell at you if you accidentally try using classes, methods, and such that are higher than your minSdkVersion, even though they are legal due to your build target.

Cannot build actionbarsherlock: BuildConfig cannot be resolved to a variable

Strangely enough, the problem was that I skipped MIPS System Image the last time I updated components in the Android SDK Manager. Now I updated MIPS System Image from revision 2 to 4, and everything builds fine.

I don't even use MIPS, but maybe there was some strange compatibility issue.

R. errors on my project when referencing ActionBarSherlock

If you are just starting to work with the ActionBar, you should probably use the appcompat v7 library instead of ABS. It provides the same backwards-compatibility with the ActionBar, but it is being developed by Google so it will work much more nicely. In fact, ABS isn't even being developed any longer because of appcompat v7.

Read about the compat libraries here
http://developer.android.com/tools/support-library/features.html

The developer guide for ActionBar is written with appcompat-v7 in mind
http://developer.android.com/guide/topics/ui/actionbar.html

Cannot build actionbarsherlock: BuildConfig cannot be resolved to a variable

Strangely enough, the problem was that I skipped MIPS System Image the last time I updated components in the Android SDK Manager. Now I updated MIPS System Image from revision 2 to 4, and everything builds fine.

I don't even use MIPS, but maybe there was some strange compatibility issue.

SherlockActivity cannot be resolved to a type

I eventually fixed my problem by updating eclipse and android SDK.

Add External Jar Library

https://github.com/jfeinstein10/SlidingMenu is a library project.

Import your library project sliding menu to eclipse.

Right Click on the library project. goto properties. Choose android. you should see Is Library checked.

In your Android project right click goto properties. Choose android. Click Add. browse the library project add and click ok.

http://developer.android.com/tools/projects/projects-eclipse.html

http://developer.android.com/tools/projects/index.html

Refering action bar sherlock( is also a library project) in Android project.(added snapshots). Check the link below for snap shots.

import .R cannot be resolved when I import actionbarsherlock

Follow the steps for sliding menu also.

R.java cannot be resolved or is not a field

This has happened to me a lot as well. I found that it was usually a problem in one of my xml layout files such as missing a closing carrot or something like that. Just double check your xml's to make sure that you didn't forget something.



Related Topics



Leave a reply



Submit