I'm really annoyed by eclipse ! I'm trying to use external project as a library (Sliding menu from J. Feinstein). The import of the library in eclipse is ok, but when I open the properties of my project and add it as a library, It doesn't work.
Eclipse tell me that it's ok, but when I build the project, I have an error telling me that eclipse can't find library.apk.
If I check the properties again, there is a red cross id front of my library.
Here is a little screenshot from the the properties window in eclipse.
http://snag.gy/4jnKk.jpg
Try to remove this row, and using "Add" connect your library project to current project.
If you have .jar file, copy it to libs folder and use "Properties - > Java Build Path - > Add jars".
I solved the problem by myself... I was using Egit plugin as CVS and it mess up something !
Now I'm using a console to handle git, and I've no problems anymore.. Thanks anyway :)
Related
Am trying to add google-play-service library in my project using import(For Google map). After adding the path am getting red X next to this reference and the reference is not adding . Know how to resolve this ?
The red X means its a broken link path.
http://developer.android.com/google/play-services/setup.html
Copy the google-play services_lib library project to your workspace (folder where your android map project is). The library project can be found under the following path.
<android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib library project .
Import the library project to your eclipse
Click File > Import, select Android > Existing Android Code into Workspace, and browse the workspace import the library project. You can check if it is library project. Right click on the library project. Goto properties. Click Android on the left panel. You will see Is Library checked.
Right click on your android project. Goto properties. Choose Android on the left panel. Click on Add and browse the library project. Select the same. Click ok and apply
Eclipse does weird things when importing an existing project (google-play-services-lib), especially if you try to import and then allow the project to be automatically 'copied' to your workspace. I had the same issue and here is how I fixed it:
Close Eclipse
Erase all google-play-services projects from your workspace
Manually copy the google-play-services-lib folder (....sdk\extras\google\google_play_services\libproject\google-play-services_lib) into your workspace
Open Eclipse
Add a new project, choosing 'Existing Android Project', then navigate to your workspace and add the newly copied google-play-services-lib project
Finally, add the google-play-services-lib to your project as a library (just like you normally would)
Hope this helps! :)
Though it's over a year for this question but never the less thought of putting it down here. Might help some one facing a similar issue.
While doing a File -> Import one probably might have selected the folder,
C:\adt-bundle-windows-x86-20130729\sdk\extras\google\google_play_services\
instead of
C:\adt-bundle-windows-x86-20130729\sdk\extras\google\google_play_services\libproject\google-play-services_lib
Quite strange as Eclipse did not correctly copy the google-play-services_lib project in my workspace, but this caused a cross mark to appear in my Project Properties.
got a perfect solution for your question. this problem is due to improper referencing of library projects. You need follow these step.
create a new project
copy all the java files from src of your previous project in which you are getting error to the new project you have created just now.
Also copy layouts xml files.
now import play services you will not get this error.
I was also getting same problem.
I copied google library folder into work space and import now it's working fine.
Try to place the Google-play-service library with in your same working Directory by coping the files from Click File > Import, select Android > Existing Android Code into Work space, and browse the work space import the library project.
This is common issue Youur google-play-service-lib project and your android project should be inside the same folder For example
if your Android Appplication name is MyMap is in D:/workspace t hen your play service lib project should be in the same directory D:/workspace
Close Eclipse. Delete
.metadata
and
.recommaditions
folders from your workplace. Import your projects back.
You add Project in to your workspace.
Start Eclipse and import project one option is ther copy to workspace do it.
After that add google play services it also copy in to your work space
and add it your library hope so its working.
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 working with Android API 17 on eclipse Indigo. I have cloned the faccebook sdk from github and done the facebook library project set up using the source project provided in the fb sdk.
Now I'm trying to include this library project in my android demo project. I have added it under Project properties->Android->Library section. Im seeing green color tick mark infront of the added library.
Also, i have added the same in the Project properties->Java build path->Projects.
build is successful. but when i try to install on my AVD, im getting the error, E/AndroidRuntime(748): java.lang.NoClassDefFoundError: com.facebook.android.Facebook
Can anybody plz help me how to fix this issue.
---- EDIT ------
One more thing I have observed is, when i opened Project properties->Android window, the green tick mark is not displaying under Library section, instead I'm seeing red cross mark.
Any ideas?
Thanks,
Venkat Papana
Same thing happen for me also.. try below .. it will work..
A Best way to add External Jars to your Android Project or any Java project is:
Create a folder called libs into you project root folder
Copy your Jar files to the libs folder
Now right click on the Jar file and then select Build Path > Add to Build Path, this will create a folder called Refrenced Library into you project, and your are done
By do doing like this, whenever you transfer you project to other Computer, you will not miss your libraries which are being referenced to some space on your Hard drive.
(The facebooksdk.jar can be found at the facebook-sdk directory: <facebook-sdk>\facebook\bin)
i know this question is old But I thought that may be it can help someone.
Move the library project and the application on the same drive. Usually this is a bug in Eclipse.
I solved my problem by moving them in same drive on my computer.
You can Give it a try.
You need to make both project in same dictionary then include it using Project Properties -> Android-> Library.
This works fine.
You do not have to add this to the library project as this is not the library.
https://github.com/facebook/facebook-android-sdk is the help of the project ad the sample code for the including the project in our code. Just you need to create the app ID for the facebook by registering your api with it.
Hope this will help you in your project.
Resolved by copying the com.facebook.android source code to my project source.
I am using Eclipse to develop Android apps. I am importing one example to the Eclipse Workspace. But I am not able to run that project as it does not load the Android library to that project.
Please see this screen shot:
In SlidingDrawer there is Android 2.2 library is added but in SlidingDrawer_Original i am not able to load the android library.
I have cleaned the project and also built the workspace but still the problem is not solved.
if I open the Java file from the SlidingDrawer_Original then it seems like below image:
So What should I have to do to load the Android Library ?
Right click Project properties >Select Android > Select your target AVD
There will be a file called .classpath , just check the Attribute of this file, It must be in read only mode, Change it to Archive Mode and the Clean the Project and set Proper Project Build and try again.
I dont know why it is Happen, But as i come to know, Eclipse always required its properties file. In Some Eclipse it is named as default.properties and in some eclipse it is as project.properties.
I have simply copy paste the default.Properties file and put it in to that project.
Then create the copy of that project in the same Workspace and remove the previous one project.
It solve my Issue. Hope it will also helpful to you.
Enjoy. :)
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