开发者

Android APIDemos Compile Errors

开发者 https://www.devze.com 2023-04-03 06:38 出处:网络
So I have read several of the similarly titled threads here, but none seem to solve my issue. I have installed E开发者_JAVA百科clipse 3.6 on a Mac (Lion), I have several Android SDKs installed.I am t

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

I have installed E开发者_JAVA百科clipse 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.


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.


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.


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.


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号