How to add Android Support v7 libraries in eclipse?

后端 未结 2 1948
轻奢々
轻奢々 2020-11-27 18:20

How do I add Android Support v7 libraries in eclipse? For example how do I add CardView to an eclipse android project?

Note: This was a self answer question, so no n

2条回答
  •  醉梦人生
    2020-11-27 18:57

    This is what worked for me. (Using the same CardView example from above)

    1. Import CardView into the workspace:
      1. Click on File, then click on Import.
      2. Expand the Android folder, and select Existing Android Code into Workspace, then click on Next >.
      3. Click on Browse beside the Root Directory text input, and select the CardView project folder in (Android SDK Install Location) > extras > android > support > v7 > cardview
    2. Right click the CardView project, click Properties, then select Android from the list on the left.
    3. Check Is Library checkbox, and click Apply.
    4. In your project, right click and click on Properties, then select Android from the list on the left, and click Add.
    5. Your imported CardView project will be listed there. Select the CardView project, then click OK, and click Apply.

    Now the library is imported.

    PS: I tried I'm_With_Stupid's answer, and while trying to add the library project to my project, it was not listed there.
    I did not have to uncheck Android Dependencies, etc. It might work in some other situation, I guess.

提交回复
热议问题