Error when creating android project in eclipse - android

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.

Related

Can't reference an Android library into my project

I would like to use the android project PagerSliding
I have imported it into my workspace.
After that I get into MY project properties add a library, and then click apply and ok, so I get :
If I reopen MY project properties right after here's what I get (Eclipse seems to loose the reference to the library).
FYI : I did have 2 workspaces before, but now I'm using only one.
I have resolved to issue by removing eclipse, and reinstalling, seems to be a Eclipse bug when previously using 2 workspaces...
According to this question SO Link
Deleting the project and importing it again worked for me.
i had the same problem there when i try to change my workspace so this my solution:
1. import and copy all project data including library project into workspace
2. delete the old project reference by Right-click on the project-->Properties-->Android-->Library, and select corrupted library(so that waht i call it) and choose Remove
3. clean project first (to refresh ur project properties)
4. go to library project Properties-->Android-->Library and check the is library if it does'nt click Apply then OK
5. if the library project is library is already checked, first Unchecked it then Clean the library project after that do the Step 4 again
6. go to project that u want the library are in then Right-click on the project-->Properties-->Android-->Library, Add then choose the library project (it should be there) and click Apply then OK
7. if still doesn't appear clean the project once more time and that should do
thanks

Android - There is no android project named

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

ActionbarSherlock not working

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.

Build path incomplete only in some workspaces (Android)

I have multiple Eclipse (3.52 "Galileo") ) workspaces so that I can keep related projects together in the same workspace. I switch between them with File > Switch Workspace.
I recently copied a good, working project to a different workspace, did a "File > Import" to import it in its new workspace, but after doing a Clean and Build, got the "The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project " error.
All my other projects build fine. I thought the "build path" referred to the search path Java or SDK files, so why would it only fail on one project ( ...a project that builds fine in a different workspace, at that)?
I've tried restarting eclipse, switching back and forth between workspaces, doing another clean and build, but no luck. Any ideas? Thanks in advance.
This may be a little late to help you, but in case others are looking, here's how I fixed it:
Right click on your project and select ‘Properties’. Then select ‘Java Build Path’, and the Library tab. Look for a JVM. If one is not there (broken link from your copied project), click ‘Add Library’ and add the default JVM. If a VM is there, select it and hit ‘Edit’ and reselect the default JVM. This should reestablish that link and fix the problem. Hope this helps.
I think Bill LaPrise might be right in most cases, but not in mine. What I eventually had to do was go into the folder where I have all my projects and delete the .metadata for Eclipse (be aware that you'll have to re-import all the projects afterwards! Also all the environment settings you've set would also have to be redone)
After it was deleted I just imported the project again, and it worked.
This was on Eclipse 4.2.0 Juno, if you're wondering.
For those encountering this error while using Maven:
Right click on the project, Build Path -> Configure Build Path...
Select the libraries tab. If Maven dependencies is not in the list,
you have identified the problem.
Close the dialog.
Right click on the project, Maven -> Disable Maven Nature
Right click on the project, Configure -> Convert to Maven Project.
Right click on the project, Maven->Update Project
Will Solve the Problem
Close Eclipse and run the below command from the terminal:
$ mvn clean eclipse:clean eclipse:eclipse
Right click on the project in the Eclipse 'Package Explorer'. Then from the drop down menu find 'Android Tools'. From the sub menu select 'Fix Project Properties'. It works wonders.
restart eclipse works on me. I am on Indigo.
In my case this issue happens after I install ADT manually by downloading .zip instead install from ADT site.
I solve the issue by right click on project -> Java Build Path. You'll see Android XXX, Android Dependencies, Android Private Libraries, Expand and click on Native library location (None), click edit button on right side then add path to ADT folder on eclipse on Location Path. Restart eclipse to complete

Problem importing Android project archives into Eclipse

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

Categories

Resources