JuiCe
JuiCe

Reputation: 4191

Want to use ViewPager, cannot get android.support.* to be recognized?

EDIT Sorry about all the pictures. I tried to give you the best idea of where I am at.

I am trying to get ViewPager working on my application, but it will not recognize the Support Library that I downloaded in the SDK manager.

I am coding for SDK Version 10. This is a screen shot of my SDK Manager:

enter image description here

After installing the Android Support Library and the most recent Tools, I went to Help >> Check for Updates. After running this I receive the two pop ups shown below.

enter image description here

The Problem Occured pop up says that it can't find a repository at that site. I installed the Sequoyah Natice Code Support when I first started developing this application but have never used it. I tried to re-install the package to get rid of this pop-up but it will not let me as it is already installed.

enter image description here enter image description here

In my code I get an error when trying to import android.support.v4.view.ViewPager;. The screen shot is below. When I hover my cursor over the import line, it says The import android.support.v4 cannot be resolved.

enter image description here

Upvotes: 5

Views: 12809

Answers (2)

mumush
mumush

Reputation: 670

For Android Studio 1.2.2

  • Right click on your project from the file hierarchy (should say "app")
  • Select "Open Module Settings" from the menu
  • Click on the "Dependencies" tab
  • Click the plus button at the bottom
  • Select "Library dependency"
  • Search/Choose your desired support library
  • Click OK

Upvotes: 5

A--C
A--C

Reputation: 36449

To add the Android Support Library to an existing Android Project:

  • Right click on your project
  • Click Android Tools
  • Click Add Support Library

That should take care of setting up the android-support jar so it can be used by the project.

Upvotes: 26

Related Questions