Can't get Android ApiDemos to work in Eclipse - eclipse

I feel a bit stupid since I develop android apps for a while now. My problem is that I can't get the ApiDemos to work with Eclipse.
Please have a look at the screenshot of my errors I get in Eclipse:
http://cheat-database.com/android.png
It looks like it can't find the xml files in the ApiDemos project. Although everything looks fine to me.
Any suggestions what I might be doing wrong?
Other (own) Android applications work fine in Eclipse.
Thanks a lot for help.

Do this: In Eclipse, File->New->Project, then either type the word "sample" in the filter text field or select Android->Android Sample Project and you will see all the projects such as ApiDemos, NotePad, etc.

The R.java is an automatically generated file. It is updated/re-generated whenever layout files, etc are changed.
I'm going to assume you tried to set up the project directly from the samples. I've seen that cause issues with write access if you don't have the privileges, and it doesn't seem to play nice when I try it either.
One thing to try would be copying the relevant ApiDemos folder to an alternate location and then try creating a new android project from that folder as follows:
Create -> New Android Project -> Create Project From Existing Source
Then point it to the location and select the relevant SDK.
It's not ideal, but at least it might get the application generating and running possibly.

Clean the project and build it again...I hope it would solve the issue

when you File->New->Other->Android Project from Existing Code, you have to tick "Copy projects into workspace".

got the same issue today :-(
this way gave me a solution very easy to use with ADT (eclipse) :
click on New Project icon --> Project --> Android --> Android Sample Project --> Next --> Select Target (for me Android 4.4) --> Next --> and then select the sample project you want to import in Eclipse (for me : legacy > ApiDemo) --> Finish
it works fine for me, i hope that could help someone :-)
#+Mathieu

Related

Reconciling BAR descriptors QNX IDE

Hello Everybody,
I am importing a sample project "Bucket-list" from Github https://github.com/blackberry/Cascades-Samples/tree/next/bucketlist in QNX IDE but not able to import successfully . Getting error .
Please have a look on Screen-Shoot and suggest me , what I will have to do for sort -out the issue.
All suggestions are welcome and appreciated
May be the issue is related to QNXIDE-Workspace setting , sometimes QNXIDE-Workspace setting changed ,Workspace setting reset is the most preferable solution in this way
I Follow some simple steps to sort-out the issue :-
1. Close QNX IDE
2. Remove .metadata folder that exist in BB10 Worspace
3. Restart QNX IDE & import the Sample project now it's compile & run fine
This happened to me after updating to the latest SDK. Applications worked properly before. Event clean projects "died" trying to compile BAR.
You can tell something is wrong by right clicking on the package, going to Properties, and selecting Actionscript Build Packaging > BlackBerry
To be clear, the instructions above about the .metadata folder is correct.
Open Explorer, go to C:\users\%username%\Adobe Flash Builder 4.7\
(orwhever the user folder is for your IDE) and rename the .metadata to old.metadata.
Restart IDE

Subversion with Eclipse for android

Okay I am starting to give up with this. I have been trying to setup sebversion in Eclipse for my android project. I have been following the following tutorial
http://blog.bauson.com/eclipse-subclipse-svn-hostgator-com.html
I got the following:
Created a repository called myRep
Created a project under with source files myRep/TestProject and attached it to trunk
installed subclipse and got it to grab the repository
Now when, it says "Checkout as a project configured using the new project wizard", I get to choose the type of project. If I choose android application project then it creates a default android project and nothing is checked out. But when I choose General Project, it does grab the whole thing in the following structure
Repositony->TestProject->Trunk->All my android files and folders
However I want it to be android project so I can compile and run it. I did a lot of googling and I need your help pleeease!
Never mind, I figured it out. Apperently, when you choose the repository you have to right click and click refresh and it will show you a list of Folders (stupid eclipse does not do it automatically). Then you choose your project and create it as a new project. Voilla, you get it compiling and running

Why does my eclipse project not have a build path?

What is the advantage with not having a build path in eclipse? Why is that setting default when it's like something you'd never use? It seems eclipse indigo was developed to make software development as obscure as possible. I just checked out a fresh copy of the project I checked in (called dungeonworld) this afternoon from another computer and automatically nothing works, can't compile, can't choose build path, can't add jre, can't add jdk, can't add that to project properties.
Is my eclipse broken? I can't believe this is happening, such an easy thing not feasible.
Nothing above solutions worked for me so i tried below
Right click on project >> properties >> project facets >> click on java
It looks like you did not add Eclipse project metadata files to your source control system, so Eclipse doesn't know what your build path is or whether it is even a java project. You can see that the little folder on your dungeonworld project is missing the little 'j', which means Eclipse doesn't think it's a java project.
Go back to your other computer and look for the following files in your original project root...
.project
.classpath
.settings/*
Make sure all of the end up in your source control system or nothing will work right.
I have same problem, but i have solved
project right click -> properties -> java build path -> src/main/sources
all remove items on "Excluded", and then that item turn the status "(None)"
I tried below steps and it works for me.
Right click on project >> properties >> project facets >> click on java
Eclipse has a build path.
It's stored in a (by default hidden) .classpath file in your project.
You can also access it through the UI in project properties (right click on your project, properties, java build path).
Well, this is probably not your problem, but similar is happening if you are in Eclipse different perspective (for example for Python).
vs.
There where no entrys after right click on my projekt in Eclipse. How to click something, wenn build path entries are missing. So my Eclpise didn't detect my java project. I used following Maven command and after that I cleaned the project too. Now Projekt works as expected. So...
If you are using Maven, try mvn eclipse:eclipse in cmd console in your project directory! Make sure to use the path to your Maven folder for the command.
For example:
cd C:\yourEclipseProject\
C:\yourPathToMaven\apache-maven-2.2.1\bin\mvn eclipse:eclipse
This was helping me. After unsuccessful web research, a coworker told me this tip.
I just had a similar problem and I figured out that I had been choosing General Project instead of Java Project while creating a project. After I chose Java>Project it solved my problem. Maybe it'll solve yours as well.
After choosing that, eclipse automatically included java libraries as well.
It's not a good practice to commit IDE related files into source control. What if someone in team uses different IDE? It might have been only option at a time when OP asked this question.
New versions on eclipse (4.x) takes care of this automatically. Probably by observing what kind of source and build files you have in your project.
Don't know the reason. But this works for me, so posting it.
Right click on project -> 'Properties' -> 'Java Build Path'.

Edit and Compile AOSP Core/System Apps in Eclipse

I've been banging my head off my keyboard all day trying to figure out how to import one of the core/system apps in the AOSP into Eclipse to edit/debug it (in this specific case, the Settings app in Android 4.0.4).
I've followed numerous guides on the subject, including this one here which got me VERY close, but the code is still returning 167 errors.
Anyone have any experience or insight with this problem?
Thanks!
This is how I have done it. Use eclipse to edit/browse/debug platform code using an eclipse project. To build the platform, I use terminal and build the whole image or build specific folder (i.e. Using mm helper).
To create eclipse project for AOSP sources, please check Using Eclipse to edit/browse AOSP.

Blackberry Eclipse Plugin - cannot generate cod file or see BB properties

I am using the BB eclipse plugin to create a BlackBerry app. I made some changes to my app but they were not reflected in the simulator. So I ran clean.bat and rebuilt the project. But now the project's cod file is not getting generated.
And if I try and view the BlackBerry project properties for the Project, I get an error saying the window contains invalid values and it doesn't let me see the BB properties of the project.
The only solution I've found in the support forums is to create a new project and copy the whole code to this workspace. But that doesn't look like a very good solution.
It seems to be a bug in the blackberry eclipse plugin. I had the same problem and "fixed" it creating a new project.
Sometimes it works launching the simulator and erasing the application in the simulated blackberry. Another trick is to delete .jar, .jad and .cod refresh and then clean all.
The last tricks that also works is to open the same workspace with the Blackberry IDE and it may repair it.
Sorry, I don't have a definite solution but I hope you can solve your problem with one of the tips.
You have to follow some steps as:-
Delete deliverables folder.
Remove all .jad files from your system. Search all .jad files in system.
Go to eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components\simulator and run clean.bat. It will reset the clean simulator.
Clean all projects from workspace.