I have download one project from https://github.com/bauerca/drag-sort-listview, it is containing library and a sample. I tried to rename the library by refactoring and build it successfully as library_dragdrop. Now when I am trying to run the sample that is "Launcher" after modify the reference of the library so it is not letting be build the project.
Updated Reference of library as :
Right click on Launcher project --> Android ---> Library and remove previous and added new from project dropdown and it is showing green but when I am cleaning and build so it goes onto previous reference as library and showing me all red.
I tried copying the package from library to "Launcher sample" but although it resolved many errors but now R cannot be resolved and still can't run the sample project.
Have you tried Project-> Clean Project?
Check all you .xml files, not only your layouts. Just a slightly error can make big problems. The editor might not show where the error is, so look thoroughly!
Related
I'm using eclipse ADT (most recent version) to develop some android apps. I've followed the getting started tutorial at the dev.android.com and it worked just fine.
But when i tried to create another project with the same targets and sdk's, i've got nothing but errors:
Some errors and my sdk's:
That's the same sdk's i used before these errors started showing up.
What can be causing this?
EDIT: my project won't generate the R.java file
You might need to add a support library to your new project.
Check this link for downloading the support libraries -
http://developer.android.com/tools/support-library/setup.html#download
Please notice that you need to import them into your eclipse and then include one (preferably the newest, not sure about this) in your project.
EDIT:
Before downloading the support libraries you should first check if you have them already.
Try this, right click project folder in the eclipse package explorer, Properties>Android>Library>Add>select a library if you have one.
There might be an invalid library included in your project already, if that happens then you will see it in the Library>Add> menu, remove it and add a new one.
You might have clean your project ........
if yes.....you must check whether R.java file is present in **Project(your project)->gen->package name->R.java**
if not than u have to update Tool Folder in SDK manager
I just downloaded the Android SDK and the plugin but when I try to create a project it automatically makes a library for the support and my project that I created has errors. Here is what I mean:
This is after I clean up the projects [Project -> Clean]
Additionally, R does not work (even when I import it) :
This is all with a clean project. I would appreciate it if you could help me.
Note: I know there are similar questions out there, but I could not get it working.
I think I need to import the appcompat package again, but I do not know where to locate it.
The error the container "Android Dependencies references non existing library" probably means your build path isn't pointing to any jar file. I recommend checking your build path:
Right click and choose 'build path'
Click on 'Android'. Make sure app_compact appears under the library target. If it does not click 'add' under library to add it.
I am importing the following project : ActionBarCompat-Basic from the Android Developers website into Eclipse.
by doing so: File -> Import => Android existing project.
However, in my package explorer, it creates me two projects :
1) The first project is named MainActivity
2) The second project is named tests.
Also, the two projects both have errors
Is that normal ? If yes, how can I solve the errors issue ?
Note, because you do not say wich project you are importing, this a blind answer.
You get two project simply because in the downloaded folder are two project.
To resolve errors first of all try to do a clean Project=>Clean... and select the projects you want to clean.
Unfortunately errors are common when you import project coming from around the web.
You should right click those projects, open Properties and check the Android tab, check if you are missing some library and try to figure out wich library is (or are).
Check Android 4.4.2 as build target.
Open the Java Build Path tab and open the Source tab, check if the gen and src folders are there, if not, add them.
If error are still there open the files marked with the error icon and try to figure out wich library they miss.
Check the Eclipse error Log.
I hope this help.
Is it possible to import an existing Java project which is in my workspace, in an Android project which is also in my workspace? The Java project doesn't use stuff that is incompatible with Android. I could do it using a .JAR, but since I'm modifying the Java project a lot, I would like to import the whole source code and change it once in a while. Is it possible? Thanks
This is somewhat of a hack, but worked for my project:
Add both Android project and plain Java project to workspace
Go to properties for Android project -> Java Build Path -> Source
Click Link Source, in "Folder name", make sure to select the root directory of the plain Java project's src tree
Use a descriptive name for "Linked folder location", like "java_project_src".
Press Finish and compile
This setup will compile the plain-java code as Dalvik bytecode. In my case, I had pure java code with very limited dependencies, but wanted to share the pure java code with non-Android projects, instead of separately maintaining these files in every project.
I think you are talking about referencing other projects into the current project, if this is the case then you can do this by Right click on project, properties->Project Reference.
You can link another projects to your current project. Right click on your main project, choose Build Path -> Configure Build Path... In the dialog choose the Projects tab, then click Add.. button. Now choose the project you want to link and click OK. You'll now be able to use this project's sources inside your main project. Hope this helps.
I'm using Eclipse to learn to develop Android applications in Java. I haven't used Eclipse before.
The project I'm trying to use (supplied by OReilly as part of 'Android Application Development') is MJAndroid. When attempting to run the project, the Run fails, and the Problems tab mentions com.java.Object can't be found, and Eclipse asks me to check the build path. Clicking
Properties -> Java Build Path -> Libraries, the message 'Unable to get system library for the project' is displayed.
On a working project, Properties -> Java Build Path -> Libraries has an entry for Android 1.1, which if I click Edit, has the classpath container path of com.android.ide.eclipse.adt.ANDROID_FRAMEWORK.
It seems a simple matter of adding the correct container path to my non-working project. However Eclipse seems determined to make this as difficult as possible. No matter what I chose to add - jars, externals jars, variables, libraries, class folders, external class folders, nothing seems to take the form of 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK' that the 'Android 1.1' entry on the working app has.
How can I add this namespace to my project so it resembles the working one?
I'm quite sure it's a problem with Eclipse's somewhat odd user interface. Frankly there' nothing I'd prefer more than a file to modify and set such information - my background is in Python, and the whole eclipse environment seems an unnecessary burden.
I had faced the same issue when I imported a sample code downloaded from the internet. I am using android sdk 1.5 with 0.9 ADT plugins. Here is a simpler way to fix the andoid library reference issues
Right click on the project which has
issues and select properties
Select the appropriate Android build
(1.1, 1.5 or 1.5 with google api) and
say ok
Again right click on the project and
select "Android Tools > Fix Project
Properties"
Fix the imports once (if required)
Refresh the project and you should be
ready to go without any manual
editing
I faced this same problem after importing a project through GIT. The problem was that I didn't have the same target android platform installed, and the build path somehow got corrupted.
The first obvious thing i did was changing the target sdk in the project.properties, but even after cleaning up the project and Android Tools > Fix Project Properties, it didn't help and I was still getting the build error.
My solution after wasting close to 1 hour trying to figure this out?
RESTART ECLIPSE
Everything worked fine after that. Eclipse is pretty fickle. Only through years of experience you'll then understand her well. :)
Had the same problem and it turns out the Android SDK Location was not set which was a really simple fix. Go to Window->Preferences, click on 'Android' on the left hand menu, fill in the location of the Android SDK (e.g. C:\Program Files\Android\android-sdk) and click OK. Everything worked fine for me after that.
Found the answer in this set up guide: http://developer.motorola.com/docstools/library/Installing-Android-Dev-Environment/
Sometimes Eclipse can get a bit funny (technical term) with classpath container resolution.
You have a working project in your workspace, so you can rule out plugin installation issues. You could try opening the .classpath file (hidden by default, select the triangle in the top-right of the Package Explorer view, select Filters... and uncheck .* resources) and manually adding the container declaration.
`<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>`
You may then have to close the project and open it again (right-click->Close Project) before Eclipse recognises the change.
You may also find that there is an Android builder and/or nature. If you compare the .project files for the working and non-working versions you may see entries for Android builders/natures. Copying the relevant entries may resolve the issue.
sometimes, eclipse can help you.
In Android projects, click right button on the project-> Android Tools -> Fix Project Properties.
It's usefull in class path errors!!
Luck!
I would verify you have the correct version of Java installed as well as the Android SDK. I would recommend installing/reinstalling the ADT plugin in your eclipse, makes it alot easier to create the android project.
http://developer.android.com/sdk/1.5_r2/installing.html
Also. I guess the path of the Android SDK must be setup correctly. This happened when I was overloaded with projects and I decided to create a new workspace copying some existing stuff into it.
Seems that the new workspace requires you to setup these details too once again
Is that setup properly?