Android - Installing Pager Sliding Tab Strip in Eclipse - android

I'm trying to install the Pager Sliding Tab Strip library and demo app into eclipse, but I get errors on installation and compile errors.
the library is here: https://github.com/astuetz/PagerSlidingTabStrip
What I have done is:
downloaded the zip file from github,
unzipped it into a folder on my windows PC,
in Eclipse selected File|Import, Existing Android Code into Workspace, Next, browsed to the root directory \PageSlidingTabStrip-master
Copy projects into workspace
finish
This leads to an error:
Android SDK: Resolving error markers' has encountered a problem.
Marker id 3158 not found.
However, a node in my package explorer tree is created for each of the library and the demo project, but the have compile errors.
What does the reported error mean? Am I doing something wrong? What is the correct way to use this library in Eclipse?

Do the following:
File->New->Other
Select Android Project
Select "Create Project from existing source"
Click "Browse..." and navigate to "PagerSlidingTabStrip-master" folder which you have downloaded from https://github.com/astuetz/PagerSlidingTabStrip
Check "library"! (Uncheck "sample"). Make sure "Copy to Workspace" is checked as well.
Click Finish. Now "library" is added to your workspace as a project. There are some errors detected but ignore them. You can right click on "library", go to "Refactor", and change it to "Lip_PagerSlidingTabStrip" (optional).
Right-click on your project -> Properties
In Android -> Library section, click "Add"
Select recently added "library" project, click Ok and you're all set. Make sure "Is library" in this window is unchecked.
EDIT
If you have faced an error subject to "Project cannot be build until the build path is correct", try to Quick Fix it by this option: "Add android.v4.supprt to Lib_PagerSlidingTabStrip."

Related

Error when creating android project in eclipse

I'm new in Android Developer and i learning. But when i create a new project, this error shown.
and in the error log i have so much error, and i don't know how can i export all of them here.
And In the project explorer, my project shown like this:
I don"t know how can i fix all of this error! Thanks for helping and sorry for my bad english!
UPDATE:
My problem is solved. The problem is from my appcompat-v7 project. My friends give me another link of this project and then try it again, and the problem is solved!
And tnx to all of you for your answers. :)
Following are the steps:
Paste the android-support-v7-appcompat.jar that you have downloaded in libs folder of your project.
Right click on your project, select Build Path -> Configure build path.
Select Library Tab then Add Jar option and browse your recently added v7 jar and click OK
that's it :)
Update :
see here
There seems to be a problem with your external library.
Go to project properties by right clicking on project.
Select android from left menu.
check for the appcompat library in bottom window.
If it is not there, add it from a valid path. Clean the project and run it again.
Right Click on the HDArtworks project.
Go to Properties>>Android
Then in the Library section: If you find a red cross in AppCompat_v7 then Select and remove it.
Then click ok. Now come back to the Solution explorer and select the Appcompat_v7 project. and do the clean and build.
When the appcompat_v7 project error free then again Right Click on the HDArtworks project. Go to Properties>>Android
Then in the Library section: If you find a red cross in AppCompat_v7 then Select and remove it. and click Add select AppCompat_v7 and click OK.
Now Clean and Build the HDArtwork project. It should solve the problem
Offline Method :
1.
or maybe you need Offline added this package.Download with Below Link :
http://downloads.puresoftware.org/files/android/extras/support.zip
extract this in SDK-root Folder/extras/android something like that in Windows : ( for me )
C:\Program Files (x86)\Android\android-sdk\extras\android
well, goto Eclipse and add this in your project by below method :
Right Click on your project Properties > Android,
after Restart, it worked fine.
2.
also, you can Copy this Folder (appcompat) ;
//you can find it with this Address :
C:\Program Files (x86)\Android\android-sdk\extras\android\support\v7\appcompat
or after Added above Download link, now ;
copy this Folder (appcompat) to Workspace and added with Properties > Android to your project.

Can't get application to find android.support.v7, won't find appcompat_v7 project

I'm trying to create an Android application in Eclipse (on Windows Vista), and I can't get it to find the android.support.v7 library stuff that I need. I think I'm setting things up correctly, and what I'm doing works on one computer but is not working at all on another, and I need help figuring out where things are going wrong.
In Eclipse, I followed the steps to create a new "Android Application Project", and selected API 11 as the minimum SDK, and went through all the other steps. (For "Create Project in Workspace", I unchecked it and asked for the files to be created in a location on a network drive, in case that matters.) This created another project, appcompat_v7, which I understand is how things work now. I built that project. But then when I tried to build my application, I couldn't get past The import android.support.v7 could not be resolved errors.
Here's the symptom that concerns me: I right-clicked on the application project and selected Properties -> Android. The bottom part, "Library", has "C:\users\me\workspace\appcompat_v7" in the left (Reference) column, and a question mark in the right (Project) column. [This is the workspace directory, not the network-drive directory where I'm keeping the files.] Also there's a red X next to the pathname. I tried selecting Add, which brought up a list including the appcompat_v7 project that got automatically added. I selected that, and it got added to the list with a green check mark. Then I selected the other one and Remove'd it. Now the list had just one appcompat_v7 project, with a green check mark, and the correct name in the right column, so everything looked OK. I clicked OK (also tried Apply then OK). But when I went to Properties -> Android again, now the red X was back and the project name was ? again. So it seems that something it was able to find just a few seconds ago could no longer be found (?). Rerunning Eclipse hasn't helped. The workspace\appcompat_v7 directory and its contents seem to show up normally in a dir command, although if there's something missing I wouldn't know what to look for.
Any suggestions about what to try, or what to check for?
EDIT: By experimenting, I've found more information. Apparently unchecking "Create Project in Workspace", and then selecting a network drive, is what causes the problem. If I start with a clean workspace, and uncheck "Create Project in Workspace" and select a directory on the C: drive, everything works fine. If I do the exact same thing but select a directory on a different drive, such as a network drive or USB flash drive, the problems show up.
After more research, I've concluded that this is a symptom of Android Issue 16472, in which things fail if you have a project on one drive and a library on another drive. The new mechanism, in which the ADT plugin creates appcompat_v7 automatically when you set up a new project, exacerbates the problem. If the workspace is on the C: drive but you want the project files to be on some other drive, by unchecking "Create project in workspace", the plugin will put the project files on your other drive but create appcompat_v7 on the C: drive, which automatically causes the problems reported for #16472.
It's probably best to set up the workspace on the same drive where you put the project files (but I haven't tested this; and in any case, having them on different drives hasn't caused a problem for me, for non-Android Java projects). However, I've found a way to work around this, by copying appcompat_v7 to the other drive:
Use the Android Application Project wizard to create a new application, and let it create your project and a new appcompat_v7 project on different drives.
Using Windows Explorer or some other method, copy the newly created appcompat_v7 from C: to someplace on the other drive.
In Eclipse, delete the appcompat_v7 project.
Import -> Android -> Existing Android Code into Workspace. Browse to the location where you've made a copy of appcompat_v7, select it, and do the import. I found that it called the new project android-support-v7-appcompat, but this is OK. I waited for "Building Workspace" to complete (if you're set up not to build projects automatically, you may have to use Build Project on the new project).
Right-click on your application project, "Properties", "Android". The "Library" section will probably have a path name (the path of appcompat_v7 on the C: drive) with a red X by it. Click on Add; a window with android-support-v7-appcompat should show up; click on that. It should be added to the library list with a green check mark. Now select the path name on the C: drive, and click Remove and then OK. I'd double-check by clicking on "Properties" again, to make sure the library shows up and still has a green check mark.
After you do this, if your workspace is set up to build automatically, this should build your application successfully. (Otherwise build it manually.)
If you later add another application to the same workspace, you don't need to repeat steps 2, 3, or 4. After the wizard creates your project and another new appcompat_v7 or appcompat_v7_2 or something, use Step 5 to add the android-support-v7-appcompat you've already imported and remove the old library reference, then delete the duplicate appcompat_v7 that it just created. (See also Remove v7 appcompat folder.)
Add the library to your application project:
In the Project Explorer, right-click your project and select Properties.
In the category panel on the left side of the dialog, select Android.
In the Library pane, click the Add button.
Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-appcompat.
In the properties window, click OK.
If you open Java Build Path dialog for the android-support-v7-appcompat project it should look like the one on the picture below.
I know this is a bit old but if anyone had the same issue I fixed like this:
From gradle leave just the last V7 (mine is compile 'com.android.support:appcompat-v7:23.1.1'
and I deleted compile 'com.android.support:appcompat-v7:22.2.0'
) after that go in your class and delete the import v7...after sync again and you will see that Android Studio will ask automatically you if you want import the new Dialog.
I hope this simple case will help someone.

Troubles while importing HoloEverywhere

I'm following this guide:
https://stackoverflow.com/a/10888882/1943607
Follow the steps below to add HoloEverywhere
Download Zip from GitHub to your computer UnZip the folder Go to
eclipse and choose File->New-> Android Project
Select Create project from existing source and then browse to the HoloEverywhereLib folder
inside extracted folder
Press Finish
Right click on the newly created project and go to Properties. Under the Android heading, you should see a section for Library with a checkbox IsLibrary. Make sure that's checked and press Add and previously added library ActionBarSherlock.
I unzipped the folder. Then went to eclipse -> Right click -> Import -> Android -> Existing Android Code into Workspace.
I select the unzipped folder and It's showing this:
When I click Finish:
And then if I create a new project, and try to import it, It cant find the library; I type org. and it isn't showing up the rest (org.holoeverywhere.app.***Activity). (Like its github says https://github.com/Prototik/HoloEverywhere#how-to-use-maven)
Can you help me out?
Edit: I've also tried to remove src from .classpath files with same result
Clone the repository using Github desktop. Install eGit on Eclipse. Then use import-->Git-->Projects from Git.

Unable to use library files to my project on android

Right now i am trying to create a graph in android,after searching from google and i got some solution as, to import the chart library files into my project.Likewise i downloaded that library file, and imported successfully into my project,but here my problem is after importing of that file my project showing error as
console
[2012-08-16 12:32:42 - Graph_test] /Graph_test/gen already exists but is not a source folder. Convert to a source folder or rename it.
[2012-08-16 12:32:44 - Graph_test] /Graph_test/gen already exists but is not a source folder. Convert to a source folder or rename it.
Can anyone tell me how to over come this issue?
Thanks in advance!.
Do this:
Right click on the project and go to "Properties"
Select "Java Build Path" on the left
Open "Source" tab
Click "Add Folder..."
Check "gen" folder and "Res" folder and click Ok and Ok again
Again right click on the project and in the "Andriod Tools" click on "Fix Project Properties"
If the library is another project on your space (or even jar file) then you can right click on your project and select properties. Then go to Android (where you choose version) and at the bottom you will find "is library" section. You can add it there by clicking on add

Eclipse Android project losing reference to library project - ViewPagerIndicator

Eclipse Version: Helios Service Release 2
Build id: 20110301-1815
I have imported the ViewPagerIndicator library into Eclipse
File->New->Android Project... Named project ViewPageIndicatorLibrary
Create project from existing source
Select source
C:\Android\development\workspace\Android-ViewPagerIndicator\library
Added compatibility library and Project builds correctly.
Project properties 'Is Library' checked. Everything fine.
In the project I want to use ViewPageIndicator, select properties.
Android Properties -> Add Library and the ViewPageIndicatorLibrary library project is available for selection.
Select the ViewPageIndicatorLibrary and it appears with green tick with a reference path of "C:\Android\development\workspace\ViewPageIndicatorLibrary"
everything appears OK.
Close the properties, reopen properties and the Library reference appears with a red cross alongside.
The Reference path appears to be correct (points to same root of the ViewPageIndicatorLibrary project as just added)
"C:\Android\development\workspace\ViewPageIndicatorLibrary"
Project name displayed as '?'.
Eclipse seems to be losing the link to the ViewPageIndicatorLibrary project.
Import references to com.viewpagerindicator.* fail to resolve.
project.properties of the main project shows
# Project target.
target=android-8
android.library.reference.1=C:/Android/development/workspace/ViewPageIndicatorLibrary
So the reference path is absolute and correct.Any ideas?
I just want to get on and use this library, but it's not playing. Deleting/re-creating library project several times now - same results, Eclipse loses link when Properties dialog is close.
I faced the same problem with google-play-services_lib. This problem occurred after I created a second eclipse workspace and copied some projects including that library.
In this situation, I had the google-play-services_lib in each workspace folder. I then deleted one folder, fixed the project setup (Android Tools) and cleaned the project in question. That solved the problem.
Might be an Eclipse bug (Juno 4.2.1).

Categories

Resources