Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot build actionbarsherlock: BuildConfig cannot be resolved to a variable

I imported the actionbarsherlock folder into the workspace using "Import -> Existing Android Code Into Workspace". Then I ensured the following:

  • In the manifest:

    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16"/>

  • Properties -> Android: Build target is API 16 (Android 4.1.2) and IsLibrary is checked.

  • Properties -> Java Compiler: Compiler compliance level is set to 1.6.

And yet I'm getting a lot of BuildConfig cannot be resolved to a variable errors.

I tried to clean all projects many times, and even restarted Eclipse several times. I even tried to add a BuildConfig class manually, but then there were still a lot of R cannot be resolved to a variable errors that I could not resolve.

I've read dozens of answers (such as this one: R cannot be resolved error when using ActionBarSherlock ), but nothing helps. Any help will be much appreciated.

like image 474
Ilya Kogan Avatar asked May 18 '13 03:05

Ilya Kogan


1 Answers

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.

like image 74
Ilya Kogan Avatar answered Sep 22 '22 05:09

Ilya Kogan