eclipse can't find android.support.v4.widget.SwipeRefreshLayout

前端 未结 9 1698
余生分开走
余生分开走 2020-11-30 11:20

Even after clicking on Add Support Library and choosing version 19, eclipse still can\'t find android.support.v4.widget.SwipeRefreshLayout. Does anyone know how to get this

相关标签:
9条回答
  • 2020-11-30 11:38

    The SDK Manager update Android Support Library to 19.1.0. But when you use Android Tools > Add Support Library, eclipse update Android Support Library to 19.0. I think this is a bug. Copy Android Support Library 19.1.0 to libs folder manually.

    0 讨论(0)
  • 2020-11-30 11:43

    It was difficult to update the support library to version 19.1 so i downloaded it manually from https://dl-ssl.google.com/android/repository/support_r19.1.zip and added the jar to my build path manually. works for me. I dont know why the 19 update shows instead of 19.1.0

    0 讨论(0)
  • 2020-11-30 11:43

    So it turns out the library is in the following location

    /android-sdk-macosx/extras/android/m2repository/com/android/support/support-v4/19.1.0
    

    As opposed to the usual

    /android-sdk-macosx/extras/android/support
    

    Also I had to restart eclipse and go to Android SDK Manager over and over and over, until the 19.1.0 version shows up.

    I hope this saves someone else some trouble.

    0 讨论(0)
  • 2020-11-30 11:44

    It looks as if you don't have the android-support-v4.jar in Java Build Path. Add it from the android-support-v7-appcompat.

    0 讨论(0)
  • 2020-11-30 11:44

    For some reason, even though you may include v4 support library or you may have v7-appcompat included in your project, you may not be able to import SwipeRefreshLayout.

    You need to make sure that

    • you change the target=android-19 to target=android-22(It should be anything greater that 19) and
    • manually import : import android.support.v4.widget.SwipeRefreshLayout; in your activity which will resolve the import related issue.
    0 讨论(0)
  • 2020-11-30 11:46

    In androidx, add

    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    

    inorder to use SwipeRefreshLayout

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