R cannot be resolved error when using ActionBarSherlock

前端 未结 6 760
走了就别回头了
走了就别回头了 2021-01-11 13:40

I am trying to use Jake Wharton\'s ActionBarSherlock to support actionbars in android projects all the way down to 1.6

I\'m getting started using the video provided

相关标签:
6条回答
  • 2021-01-11 14:03

    My fault was, that the ABS-project and my project had different API levels. ABS was on level 4.0.3 and my project had 3.0. After changing the API level of my project to 4.0.3 all errors were fixed. This post helped me to find the solution.

    0 讨论(0)
  • 2021-01-11 14:06

    Found it!

    Instead of:

    Project > Clean > Clean Projects Selected Below

    you must use

    Project > Clean > Clean All Projects

    Even if none of the other projects have anything to do with the library project. This fixed the problem

    0 讨论(0)
  • 2021-01-11 14:07
    • As usual anytime R file not created you should first try:

    Project > Clean > Clean All Projects

    • If that doesn't help, make sure you have set a high enough SDK version, I think it should be at least 14 or higher for ActionBarSherlock:

    enter image description here

    • Lastly, go to Android SDK Manager and check if there is a update Android SDK Platform-tools and Android SDK Build-tools to version 17. If yes, update it and RESTART eclipse
    0 讨论(0)
  • 2021-01-11 14:23

    Instead of importing the single folder actionbarsherlock, I ended up picking the parent folder and unchecked everything but actionbarsherlock in the Import Projects window.

    enter image description here

    0 讨论(0)
  • 2021-01-11 14:24

    Mine was different:

    I have a 64bits OS (linux mint) and I had to install the 32bit libraries:

    sudo apt-get install ia32-libs
    

    After this just clean all and build a new project and it worked.

    0 讨论(0)
  • 2021-01-11 14:28

    Might also need to make sure your nen/R.java file is created for the right package name:
    On AndroidManifest.xml, make sure the manifest tag, package attribute is set to:

    "com.actionbarsherlock"

    0 讨论(0)
提交回复
热议问题