Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with APIDemos sample android [duplicate]

Tags:

android

So I have read several of the similarly titled threads here, but none seem to solve my issue.

I have installed Eclipse 3.6 on a Mac (Lion), I have several Android SDKs installed. I am trying to open and run the APIDemos app from the 2.3.3 Samples folder.

I do this using File->New Project->Android Project->

Once in there, I select Target = Android 2.3.3

At that point, I select 'Create Project From Existing Sample' and select 'ApiDemos'.

The project opens, and I am immediately shown 862 Errors (not Warnings). I am unable to compile or run, and am not sure where to start to get these errors to compile. I'm assuming something, somewhere, is not seeing a file as it should...but I'm just not sure what it is...

The frustrating thing is other Sample projects are working, but I would like to get the ApiDemos up and running on my device for testing purposes.

I appreciate any feedback.

like image 234
belsokar Avatar asked Sep 08 '11 10:09

belsokar


4 Answers

I guess it must be the java compliance level problem. Go to your project properties, and set the Java Compiler's Compiler Compliance level to 1.6. See if that fixes the errors.

like image 107
Ronnie Avatar answered Sep 30 '22 03:09

Ronnie


I had the same problem and this is my solution.

  1. Uncheck "Build automatically" in the menu "project"
  2. Select "Clean" from menu "project".
  3. Select "Clean projects selected below" and check "ApiDemos".
  4. Check "Start a build immediatly", "Build only the selected projects"

Then it compiles as it should (at least for me).

After this you can check "Build automatically" in the menu "project" again.

like image 29
Riffer Avatar answered Sep 30 '22 03:09

Riffer


I got similar problems. I spent some hours to figure out a solution: delete project files of ApiDemos in Eclipse's workspace folder. Then re-add project ApiDemos.

I guess that some of the generated objects don't refresh after I update Android SDK.

If you have never build and run ApiDemos before, my solution should not apply your case.

like image 45
Cameron Wong Avatar answered Sep 30 '22 01:09

Cameron Wong


Actually the combination of Cameron Wong's, Riffer's and userSeven7s's posts did the trick for me:

  1. deleted Api Demos folder in the eclipse workspace folder
  2. reopened project from android samples
  3. Set Compiler Compliance level to 1.6
  4. Cleaned/Rebuilt
like image 33
P.Melch Avatar answered Sep 30 '22 01:09

P.Melch