ActionBarSherlock - The type android.support.v4.app.Fragment cannot be resolved. It is indirectly referenced from required .class files

前端 未结 9 1433
走了就别回头了
走了就别回头了 2020-12-02 18:41

I am using ActionBarSherlock as a library project in a project which is a library itself. It was all working fine until I moved the project to a new computer and updated the

相关标签:
9条回答
  • 2020-12-02 18:54

    I had the same problem as you since I had updated the SDK. I have solved my problem by doing this (on eclipse) :

    • Right click on the action bar sherlock library => Properties => Java Build Path => Order and Export tab => check android support v4 or Android Private Libraries and select Ok
    • Right click on your personal project and go to properties => java build path => check Android Private Libraries
    • Clean both projects, it should work.
    0 讨论(0)
  • 2020-12-02 18:54

    I am new to stackoverflow. However this is my solution or experience here. I solved this by Project Properties--> 'Android' on the left Panel -->Add--> Select the required support library from the drop down menu-->'Apply'-->OK

    This got it done. This worked even when 'Android Private Libraries' was unchecked from 'Order and Export' of Java Build Path.

    0 讨论(0)
  • 2020-12-02 18:56

    In my case I'm using 2 Android libraries which require the android support library. The problem was that both libraries had different versions of the Android support library.

    To resolve the issue: Right click on the library project => Android Tools => Add Support Library.

    Repeat this action for each library.

    0 讨论(0)
  • 2020-12-02 19:01

    Here is simplest solution:

    Right click on your project folder -> Build path -> Configure build path -> Add External Jars(From libraries tab) -> select "android-support-v4.jar" file.

    (It'll be located in Android SDK folder here is generic path "android-sdk\extras\android\support\v4").

    After this clean you project and happy coding...

    0 讨论(0)
  • 2020-12-02 19:03

    I faced the same problem in my case i resolved it by right clicking on the project -> Buid path -> Configure Build path -> "select Android from left hand list" -> "select the check box for build project target from the right hand panel" -> click Apply -> click Ok

    0 讨论(0)
  • 2020-12-02 19:09

    What worked for me was a little different than the solutions by @Sebastien and @FleshWound above in the thread.

    • Copied the file "android-support-v4.jar" from /MyProject/libs/ and overwrote the one at /ActionBarSherlock/libs/android-support-v4.jar.
    • Went to "Project Properties" -> "Java Build Path" -> "Add" -> ActionBarSherlock project.
    • Clean project.
    0 讨论(0)
提交回复
热议问题