I'm developing an app currently which shall use ActionBarSherlock and HoloEverywhere however whenever I try to import the HoloEverywhere library into eclipse I get the following error:
Build path contains duplicate entry: 'src' in project 'library'
I have checked the library folder and there is no duplicate in it but it still complains.
Thank you in advance.
This is how mine solved:
property->resource->Android, tick an Android build target then click OK
Had the same issue,
try this:
Just import it with the duplicate src error, then right click on the HoloeEverywhere library project and select properties. In properties select Android (on the left) and under Project Build Target check if the Target Name Android 4.2 (or whatever yours is) is checked. Mine wasn't. If you check it, it should fix the problem.
Both projects "HoloEverywhere" and "ActionBarSherlock" has name "library". So, you probably should rename them. Then import both projects (ignore HoloEverywhere error). Choose "Android option" in "HoloEverywhere" project properties. Remove all bad references and add new reference to "ActionBarSherlock" project library.
To fix this you have to right click on the project name on the left hand side and choose properties, then choose Android and add a tick to the Build target e.g Android 4.0, don't forget to apply and click ok afterwards.
Right Click on the HoloEverywhere project, go to Android, in the Library section, removes the selected and them select the ActionBarSherlock library that already is in your workspace.
No obvious duplications in path and after hours of trying various suggestions, I change the target (in both the project properties and manifest) from 15 to 17 to solve this issue.
To fix it, open .classpath file in your project home directory and comment out any one of the following two lines
< classpathentrykind="src"path="onePath"/>
< classpathentrykind="src"path="anotherpath"/>
here one and another Paths are the paths that are referencing your library.
Then, right click the Project->Android Tools-> Fix Project Properties. Then clean and build your project.
Related
I have a problem with actionbarsherlock that it drives me crazy!
I have a new workspace, I imported my project and the library projects. There is also actionbarsherlock library project.
My project doesn't generate R file, I suppose because there isn't actionbarsherlock in library path.
image 1
I import the library project and fix the path...
image 2
I clean project but if I return to project properties in the android section I SHOW LIKE IMAGE 1!!!!! It seems like eclipse doesn't save project's changes..
I try:
Change project Build Target to 4.2.2 (In my project and in actionbarsherlock).
Change in java compiler the 1.6 java compiler compliance level (checked "enable project specific settings").
Change in manifest.xml android:minSdkVersion="8".
Add android support libraries.
Refresh & clean projects...
What am I doing wrong?????
I post 2 other images and the eclipse problems..
image 3: my project
image 4: actionbarsherlock project: I change android 4.3 to 4.2.2 after screen capture..
Eclipse problems
Error retrieving parent for item: No resource found that matches the given name '#style/Theme.Sherlock'.
Cannot cast from Activity to MainActivity.
Error retrieving parent for item: No resource found that matches the given name '#style/Widget.Sherlock.ActionBar.Solid'.
Menu cannot be resolved to a type.
etc etc...
Thak you very much.
Actually you have only one problem. ie, ABS library import. If it is fixed, second problem will vanish.
The problem is your library location(you fade out it in pics;)). Try this,
1.Delete the library from project explorer(be careful, don't delete original files from disc).
2.Go to your original workspace folder and make sure that the library ABS(actionbar sherlock) is out of all other folders( the folder
contains only that library). If not, cut&past it out( or you can paste
it inside your project folder).
3.Import the library from new location.
Now, add the library to your project and see if the problem resolved.
After some time, to fix them I did some things:
Delete all my project in eclipse (not from disk).
Close eclipse.
New Workspace (3rd).
change directory of actionbarsherlock and my project
import in eclipse all actionbarlibrary (with sample project, actionbarsherlock-i18n, etc..).
import my project
fix library
close another time eclipse
now it seems to work...
Thanks to all for your answers.
Dang. I'm sorry for asking so many different questions here. So, I have an android project that I imported into my workspace. Then, after fixing any build path errors and stuff, I went to export it. When I first imported it, it was automatically name "MainActivity". So, I tried to export it but I get the error "There is no android project named MainActivity. I checked and the folder is in my workspace. I searched but couldn't find a working answer. I guess eclipse sees this code as something else. I'm almost positive when I imported it I selected to import exisiting android application project...
You are trying to run your Library Project, if the project is not libraryRight Click on the Project >> Properties >> Android >> In the right Panel Scroll down >> Uncheck isLibrary
Eclipse probably sees your project as a library instead of an Android project.
Check your project.properties file (you'll find it as the very last file in your project in Package Explorer on the left). If at the bottom you see the line:
android.library=true
Just get rid of it, or try setting it to false. It should normally solve the problem.
It is probably you had set your project as library.
Try to change the setting at Project > Properties > Android > Library and UNCHECK Is Library
I am trying to run a project but there is a red exclamation mark over the project name. When checked in Problems, its throwing an error "project is missing required library". The library is pointed to android.jar located in some path. When checked in package explorer, I found the android.jar in Android 2.3.1 folder structure of project in package explorer. The android.jar located in Android 2.3.1 folder is pointing to some other path. Is the build error occurring due to the difference in paths for android.jar files? I have imported the project.So, how should I modify the path which is shown in the problems window? I am newbie to android and so pls help me.
Thanks!!!
The easiest way to resolve this common problem is to re-associate your project with an SDK version. You do this by opening project properties, clicking on Android, select a different SDK version to that which is currently selected (if one is selected at all), click okay, and then repeat the process to switch back to the desired SDK version, if desired.
I tried Phillip's answer and it didn't work in my case. Another place to look is opening project properties and clicking on "Java Build Path" -- if your project used some external JARs, check to make sure the links haven't been broken. If they have, reimport them again and remove the missing ones.
Import your library through the option: File/ Import... / Android / Existing Android Code Into Workspace, and not by creating a New Project and referencing the other (if you did this way).
I had this same problem and solved that way. As example, there is a PDF which demonstrates how to import other projects [Look at the page 28] (The material are in Portuguese)
I am having problems getting start with the ActionBarSherlock. I downloaded the 4.1.0 version and followed the following tutorial for installing it.
http://www.youtube.com/watch?v=4GJ6yY1lNNY
The Problem I am facing is whenever I make a new project and add the library project of ActionbarSherlock to it. I get the following error.
Description Resource Path Location Type
The container 'Android Dependencies' references non existing library 'C:\Work\JakeWharton-ActionBarSherlock-4.1.0-0-g9598f2b\JakeWharton-ActionBarSherlock-88fc341\library\bin\com_actionbarsherlock.jar' myapp Build path Build Path Problem
Please anybody help me with it.
I just had the same problem: A .jar file is requested, but non-existing. Also, it is okay that the file doesn't exist, because we want to use a Android-Library Project and not an included jar-library.
The steps described by Aqif Hamid are perfectly fine, if the missing import (.jar or library project) would be the root of the problem. But i figured out that the reason for this error is that you have to set both projects (AndroidBar Sherlock and your own Android project) to Java Compliance Level 1.6
To do so go into Project Properties => Java Compiler and set the level to 1.6
Of course, you have to install JDK 1.6 on your computer...
Hope this helps you too!
The only thing that it works for me was selecting at Properties at Java Compiler Tab Compilance Level --> 1.7 (It was 1.6).
After that Android Tools, Fix Project Properties
DO the followings:
just like you have bin, res folders. right click on your project and
add a folder named 'libs' (if libs folder is not already there).
Then copy paste your com_actionbarsherlock.jar file in this libs folder.
Right-click on your com_actionbarsherlock.jar file and click Add to Build Path.
Now clean and build your project. You should be good to go.
Edit:
To add project as a library do this:
Make sure you have your library project in your projects list and it
is open.
Right click on your project in which you want to add your library
project and select Porperties.
Click Android in properties windows, now scroll down, you will see
library section at the bottom. There press Add button.
Now a window will open in which you will see list of library
porjects. Select your required project and press Ok. Now that library
project must be there with a green tick mark.
Press Apply and Ok button.
You should be good to go now.
regards,
Aqif Hamid
I am of the understanding that you cannot include ActionBarSherlock into your project by adding a jar to your lib directory (or just including the jar at all). You will have to create an android project for ActionBarSherlock then link to it as a library:
Create ActionBarSherlock project in Eclipse
Right-click your project and go to Properties
Select Android in the left pane
Then in the right pane, towards the bottom you can Add... the ActionBarSherlock project you created in step 1.
If you are curious why the jar approach doesn't work, I give you Jake's reply in this thread
(although that's a month and a half old at this point).
1 - create a libs folder (parallel to manifest) and put the jar in that
Your Project -> right click -> Properties -> Java Build Path -> Libraries -> Add Jar ->
yourjar.jar
This video might be useful in case you are having some issues.
http://mobile.tutsplus.com/tutorials/android/jar-for-android/
Clean your actionbarsherlock project. It will generate the .jar file for you when it re-builds.
Using the Android Tools option to Add compatible libraries fixed the problem for me.
My apologies if this is a stupid newbie question...
I'm using Eclipse (Helios release) and have the Android SDK all configured as per the developer.android.com recommendations. I can create and run new projects without any problem but I can't import archived project code samples (found on the web etc.) using Import > Existing Projects Into Workspace.
Importing a zip creates a project but it doesn't create it as an Android project and the console displays the error: "Project has no default.properties file! Edit the project properties to set one."
I've tried going into the project Properties but as soon as I click on 'Android' in the properties tree a pop-up appears saying "Could Not Accept Changes: The currently displayed page contains invalid values"
See: http://screencast.com/t/ZmY3ZWQ4
But if I do this on one of my own projects I have no such error, and I'm able to change things such as the Android Platform/API level. I'm also able to archive my own projects (using export) and import them again without any problems... nut not other people's archives! Am I being really stupid?
Any help would be really appreciated!
All the baseline default.properties needs is a line like:
target=android-8
You can most likely copy another projects' default.properties into this project. A (not-so-)quick restart of Eclipse, a rebuilding of the workspace, and you're off to the races.
It's really lame that this is needed -- it should happen as part of the import process, I would think.
just change your
project.properties file to default.properties
and restart your eclipse
it's done..
Right click on the project in navigator window, go to android tools and click on fix project properties. It might work, as it did for me ;-)
You can look at this section, it works for me:
Project has no default.properties file!
If you want to change the library of your project, do that :
- right click on the project name
- Build Path
- Configure build path
- click Android on the left, and select the library you need.
I had the same problem.
What you are trying is little difficult.Just unzip the files ,copy res and src folders
to ur existing project.The problem is the files starting with "." which have settings for their android and eclipse.
So you need to modify all that,so simply create new project or to ur existing one copy res, src and AndroidManifest.xml file.
It worked for me .
In the project right click Android Tools -> Fix Project Properties