ApiDemos 3.0 / 3.1 will not build due to unresolved types

I am trying to create ApiDemos for API levels 11 (3.0) and 12 (3.1). I updated to the latest version both tools (version 11) and platform tools (version 4). In addition, I have installed a compatibility package.

When I try to build an ApiDemos project, I get thousands of errors, from which Eclipse shows 100 of the following values:

ActionBar cannot be resolved to a type ActionBarDisplayOptions.java /ApiDemos3.1/src/com/example/android/apis/app line 34 Java Problem ActionMode cannot be resolved to a type Grid3.java /ApiDemos3.1/src/com/example/android/apis/view line 133 Java Problem alertDialogIcon cannot be resolved or is not a field AlertDialogSamples.java /ApiDemos3.1/src/com/example/android/apis/app line 82 Java Problem animator cannot be resolved or is not a field FragmentHideShow.java /ApiDemos3.1/src/com/example/android/apis/app line 55 Java Problem Animator cannot be resolved to a type AnimationLoading.java /ApiDemos3.1/src/com/example/android/apis/animation line 73 Java Problem 

I need help for the proper assembly of samples. Thanks.

+3
source share
2 answers

It seems that the compatibility jar file contains only support for fragments, and not for classes such as ActionBar, which are available only in API11 and 12. If you do not create using API11 or 12 as your goal, you will not be able to use these classes.

+6
source

This is actually the answer to further problems with ApiDemos for API 15. If someone has problems starting because of some errors (about 3000 errors in my case), then the answer edits the project.properties file, so it says target=android-15 instead of 8 .

Restore / clean + rebuild your project.

+3
source

All Articles